2

I use doctest for a very simple TDD approach by running the following command at a main entry point in any IDE/editor which supports debugging:

pytest.main(["--doctest-modules", "path/to/my/modules"])

I now just have to 'run my project' (press F5) to run all doctests - even in modules which can't be executed directly (this is why I'm running pytest instead of doctest).

This is working fine but could be even better if - in case of an unhandled exception - my IDE could jump to the location where it had been thrown (like it would when I run 'normal code').

For pytest there seems to be a way to disable catching exceptions but it looks like this doesn't work together with --doctest-modules.

Is there a way to let doctest behave the way I need it to? I'm looking for an approach which allows me to run doctest on modules.

frans
  • 8,868
  • 11
  • 58
  • 132

0 Answers0