how to tell PyCharm to run pytest on test files not doctests

Viewed 174

In the test suite of a module, some test_foo.py files have helper functions containing doctests patterns in their docstrings. This causes PyCharm to offer Debug 'Doctests in test_foo' when selecting a function inside that file and trying via context-menu to debug just that function. It doesn't matter whether that function is before any actual test_...() function or at the end of the file, the mere presence of a single docstring with a doctests pattern causes PyCharm to exhibit this behavior.

If I just change all the >>> ... into />>> ... for example (to cripple the doctests search), then the behavior is as expected for a test file: context-menu on a function offers Debug 'pytest for test_foo.test_function'.

Is there a way to tell PyCharm to prioritize pytest over doctests if both are feasible?

1 Answers
Related