Skip to content

Commit

Permalink
Update config._getconftest_pathlist for pytest-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
saimn committed Jun 13, 2021
1 parent e122535 commit 9b9f271
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,14 @@ def pytest_ignore_collect(self, path, config):
dirpath = Path(path).parent
else:
dirpath = path.dirpath()
collect_ignore = config._getconftest_pathlist("collect_ignore", path=dirpath)

try:
collect_ignore = config._getconftest_pathlist("collect_ignore", path=dirpath)
except TypeError:
# Pytest 7.0+
collect_ignore = config._getconftest_pathlist("collect_ignore",
path=dirpath,
rootpath=config.rootpath)

# The collect_ignore conftest.py variable should cause all test
# runners to ignore this file and all subfiles and subdirectories
Expand Down

0 comments on commit 9b9f271

Please sign in to comment.