Add ability to exclude files matching glob patterns in conftest.py
This adds the `collect_ignore_glob` option for `conftest.py` to allow Unix-style wildcards for excluding files.
This commit is contained in:
@@ -303,7 +303,10 @@ def pytest_ignore_collect(path, config):
|
||||
if py.path.local(path) in ignore_paths:
|
||||
return True
|
||||
|
||||
ignore_globs = []
|
||||
ignore_globs = config._getconftest_pathlist(
|
||||
"collect_ignore_glob", path=path.dirpath()
|
||||
)
|
||||
ignore_globs = ignore_globs or []
|
||||
excludeglobopt = config.getoption("ignore_glob")
|
||||
if excludeglobopt:
|
||||
ignore_globs.extend([py.path.local(x) for x in excludeglobopt])
|
||||
|
||||
Reference in New Issue
Block a user