Where and how does py.test look for fixtures? I have the same code in 2 files in the same folder. When I delete conftest.py, cmdopt cannot be found running tes
Here is the order and where py.test looks for fixtures (and tests) (taken from here):
py.test loads plugin modules at tool startup in the following way:
by loading all builtin plugins
by loading all plugins registered through setuptools entry points.
by pre-scanning the command line for the
-p nameoption and loading the specified plugin before actual command line parsing.by loading all
conftest.pyfiles as inferred by the command line invocation (test files and all of its parent directories). Note thatconftest.pyfiles from sub directories are by default not loaded at tool startup.by recursively loading all plugins specified by the pytest_plugins variable in
conftest.pyfiles