Skip to content

Commit 02649fd

Browse files
authored
Merge pull request #201 from pllim/fix-ignore-collect
MNT: Do not completely take over test collection ignore
2 parents e1eea63 + 8f25181 commit 02649fd

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
0.12.2 (unreleased)
22
===================
33

4+
- Compatibility with pytest 7.4 with respect to ``norecursedirs`` handling. [#201]
5+
46
- Respect ``--doctest-continue-on-failure`` flag. [#197]
57

68
- Report doctests raising skip exceptions as skipped. [#196]

pytest_doctestplus/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def get_list_opt(name):
554554
self._ignore_paths.append(path)
555555
break
556556

557-
return False
557+
# None = Let other plugins decide the outcome.
558558

559559
def pytest_collect_file(self, path, parent):
560560
"""Implements an enhanced version of the doctest module from py.test

tests/test_doctestplus.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,3 +1142,26 @@ def foo():
11421142

11431143
result = testdir.inline_run(build_dir, '--doctest-plus', '--doctest-modules', '--doctest-ufunc')
11441144
result.assertoutcome(passed=2, failed=0)
1145+
1146+
1147+
def test_norecursedirs(testdir):
1148+
testdir.makeini(
1149+
"""
1150+
[pytest]
1151+
norecursedirs = \"bad_dir\"
1152+
doctestplus = enabled
1153+
"""
1154+
)
1155+
subdir = testdir.mkdir("bad_dir")
1156+
badfile = subdir.join("test_foobar.py")
1157+
badfile.write_text("""
1158+
def f():
1159+
'''
1160+
>>> x = 1/3.
1161+
>>> x
1162+
0.333333
1163+
'''
1164+
fail
1165+
""", "utf-8")
1166+
reprec = testdir.inline_run(str(testdir), "--doctest-plus")
1167+
reprec.assertoutcome(failed=0, passed=0)

0 commit comments

Comments
 (0)