Skip to content

Commit

Permalink
MAINT: cleanup version check to close #158
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Oct 2, 2022
1 parent 296678e commit b09974a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pytest_doctestplus/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,16 +499,12 @@ def pytest_ignore_collect(self, path, config):
"""
if PYTEST_GE_7_0:
dirpath = Path(path).parent
else:
dirpath = 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)
else:
dirpath = path.dirpath()
collect_ignore = config._getconftest_pathlist("collect_ignore", path=dirpath)

# 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 b09974a

Please sign in to comment.