From b09974aa265a5f2bb1ccb7262e0e87985ef1ca83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Sat, 1 Oct 2022 21:26:37 -0700 Subject: [PATCH] MAINT: cleanup version check to close #158 --- pytest_doctestplus/plugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pytest_doctestplus/plugin.py b/pytest_doctestplus/plugin.py index c9388d1..263478c 100644 --- a/pytest_doctestplus/plugin.py +++ b/pytest_doctestplus/plugin.py @@ -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