diff --git a/CHANGES.rst b/CHANGES.rst index c48aced..cab88cc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,8 @@ 0.12.2 (unreleased) =================== +- Compatibility with pytest 7.4 with respect to ``norecursedirs`` handling. [#201] + - Respect ``--doctest-continue-on-failure`` flag. [#197] - Report doctests raising skip exceptions as skipped. [#196] diff --git a/pytest_doctestplus/plugin.py b/pytest_doctestplus/plugin.py index 78235d1..e1cca3b 100644 --- a/pytest_doctestplus/plugin.py +++ b/pytest_doctestplus/plugin.py @@ -554,7 +554,7 @@ def get_list_opt(name): self._ignore_paths.append(path) break - return False + # None = Let other plugins decide the outcome. def pytest_collect_file(self, path, parent): """Implements an enhanced version of the doctest module from py.test diff --git a/tests/test_doctestplus.py b/tests/test_doctestplus.py index d266bc5..6e4148e 100644 --- a/tests/test_doctestplus.py +++ b/tests/test_doctestplus.py @@ -1142,3 +1142,26 @@ def foo(): result = testdir.inline_run(build_dir, '--doctest-plus', '--doctest-modules', '--doctest-ufunc') result.assertoutcome(passed=2, failed=0) + + +def test_norecursedirs(testdir): + testdir.makeini( + """ + [pytest] + norecursedirs = \"bad_dir\" + doctestplus = enabled + """ + ) + subdir = testdir.mkdir("bad_dir") + badfile = subdir.join("test_foobar.py") + badfile.write_text(""" + def f(): + ''' + >>> x = 1/3. + >>> x + 0.333333 + ''' + fail + """, "utf-8") + reprec = testdir.inline_run(str(testdir), "--doctest-plus") + reprec.assertoutcome(failed=0, passed=0)