Skip to content

Commit b92fa5e

Browse files
committed
TST: verbose output for debugging
and globally ignore ResourceWarning TST: Revert scientific-python#307
1 parent 0e170b9 commit b92fa5e

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

.github/workflows/python-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
- os: windows-latest
6565
python-version: '3.14'
6666
toxenv: py314-test-pytestdev
67+
posargs: -v
6768
- os: macos-latest
6869
python-version: '3.14'
6970
toxenv: py314-test-pytestdev

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ filterwarnings =
6161
# For pytest-asyncio deprecations that is expected to be resolved upstream
6262
# https://github.com/pytest-dev/pytest-asyncio/issues/924
6363
ignore:The configuration option "asyncio_default_fixture_loop_scope":pytest.PytestDeprecationWarning
64+
# Windows + Python 3.14 + pytest-dev have ResourceWarning, see
65+
# https://github.com/scientific-python/pytest-doctestplus/issues/305
66+
ignore::ResourceWarning
6467

6568
[flake8]
6669
max-line-length = 100

tests/test_doctestplus.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import glob
22
import os
33
import sys
4-
import warnings
54
from platform import python_version
65
from textwrap import dedent
76

@@ -26,7 +25,6 @@
2625

2726

2827
PYTEST_LT_6 = Version(pytest.__version__) < Version('6.0.0')
29-
PYTEST_LT_8_5 = Version(pytest.__version__) < Version('8.5.0.dev')
3028

3129

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

734732
testdir.inline_run('--doctest-plus').assertoutcome(passed=2)
735-
if os.name == "nt" and python_version() == "3.14.0" and not PYTEST_LT_8_5:
736-
with warnings.catch_warnings():
737-
# ResourceWarning unclosed file pytest.EXE --> PytestUnraisableExceptionWarning
738-
warnings.filterwarnings("ignore")
739-
testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
740-
else:
741-
testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
733+
testdir.inline_run('--doctest-plus', '--doctest-rst').assertoutcome(passed=3)
742734
testdir.inline_run(
743735
'--doctest-plus', '--doctest-rst', '--ignore', '.'
744736
).assertoutcome(passed=0)

0 commit comments

Comments
 (0)