You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Config variable to set locations to try for conftest.py files #430
Originally reported by: holger krekel (BitBucket: hpk42, GitHub: hpk42)
Discussed with @jurko and others: It would be good to have a conftestscan ini variable which you can set in order to have pytest scan for conftest files. Examples:
conftestscan = test*/conftest.py (the default) would make pytest look for a conftest.py in any sub directory of the directory containing the ini-file.
conftestscan = test*/**/conftest.py would make pytest do a recursive search in all subdirs.
conftestscan = myproj/**/conftest.py would make pytest scan all subdirs in the project/package directory for conftest.py files.
Note that the only effect of conftestscan is to load conftest files early and make e.g. its command line options available. Any fixture functions or e.g. pytest_runtest_* hooks would still only be available to all the tests under the directory of the respective conftest.py file where they are defined. In other words, conftestscan does not turn conftest.py into global plugins.
Activity
pytestbot commentedon Jan 23, 2014
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
Issue #416 was marked as a duplicate of this issue.
RonnyPfannschmidt commentedon Apr 20, 2016
@hpk42 is this sill an issue after we already support local plugins and opt out of deep scan?
not enforcing python3.6 for precommit hook (pytest-dev#430)
RonnyPfannschmidt commentedon Mar 1, 2020
it actually is
blueyed commentedon Mar 1, 2020
Ref:
pytest/src/_pytest/config/__init__.py
Line 449 in f860083
testmeh/conftest.pywas used (within a test), butmeh/conftest.pywas not.