Is it possible to write a doctest unit test that will check that an exception is raised?
For example, if I have a function foo(x) that is supposed to raise an exception if x < 0, how would I write the doctest for that?
Is it possible to write a doctest unit test that will check that an
Share
Yes. You can do it. The doctest module documentation and Wikipedia has an example of it.