Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/test_doctestplus.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import glob
import os
import sys
import warnings
from platform import python_version
from textwrap import dedent
import sys

from packaging.version import Version

Expand All @@ -25,6 +26,7 @@


PYTEST_LT_6 = Version(pytest.__version__) < Version('6.0.0')
PYTEST_LT_8_5 = Version(pytest.__version__) < Version('8.5.0.dev')


def test_ignored_whitespace(testdir):
Expand Down Expand Up @@ -730,7 +732,13 @@ def f():
testdir.makefile('.rst', foo='>>> 1+1\n2')

testdir.inline_run('--doctest-plus').assertoutcome(passed=2)
testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
if os.name == "nt" and python_version() == "3.14.0" and not PYTEST_LT_8_5:
with warnings.catch_warnings():
# ResourceWarning unclosed file pytest.EXE --> PytestUnraisableExceptionWarning
warnings.filterwarnings("ignore")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be a bit too wide, but there are so many conditions it needs to catch that I don't mind it much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to catch ResourceWarning specifically but it didn't work. Catching PytestUnraisableExceptionWarning is a little meaningless.

testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
else:
testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
testdir.inline_run(
'--doctest-plus', '--doctest-rst', '--ignore', '.'
).assertoutcome(passed=0)
Expand Down