After adding a doctest to a file, setup() is called if defined in the same file #10825
Labels
plugin: doctests
related to the doctests builtin plugin
plugin: nose
related to the nose integration builtin plugin
type: bug
problem that needs to be addressed
Suppose your project contains a file with a function named
setup()
. You run tests, everything works. Then you add a doctest to the said file and run your tests again. Now they fail, because pytest decided to call thesetup()
function automagically.Minimal reproducer:
The long error message
To prevent this from happening, you can pass
-p no:nose
to disable thenose
plugin.This behavior first appeared in 7.0.0rc1 and I'm pretty sure it was introduced in #9273 (or at least I figured out how to work around it by reading the diff in #9273)
Please just close this if it is a feature and not a bug. I'm not sure, and it's easy to work around anyway :)
The text was updated successfully, but these errors were encountered: