|
1 | 1 | import glob |
2 | 2 | import os |
| 3 | +import sys |
| 4 | +import warnings |
3 | 5 | from platform import python_version |
4 | 6 | from textwrap import dedent |
5 | | -import sys |
6 | 7 |
|
7 | 8 | from packaging.version import Version |
8 | 9 |
|
|
25 | 26 |
|
26 | 27 |
|
27 | 28 | PYTEST_LT_6 = Version(pytest.__version__) < Version('6.0.0') |
| 29 | +PYTEST_LT_8_5 = Version(pytest.__version__) < Version('8.5.0.dev') |
28 | 30 |
|
29 | 31 |
|
30 | 32 | def test_ignored_whitespace(testdir): |
@@ -734,9 +736,17 @@ def f(): |
734 | 736 | testdir.inline_run( |
735 | 737 | '--doctest-plus', '--doctest-rst', '--ignore', '.' |
736 | 738 | ).assertoutcome(passed=0) |
737 | | - testdir.inline_run( |
738 | | - '--doctest-plus', '--doctest-rst', '--ignore', 'bar.py' |
739 | | - ).assertoutcome(passed=2) |
| 739 | + if os.name == "nt" and python_version() == "3.14.0" and not PYTEST_LT_8_5: |
| 740 | + with warnings.catch_warnings(): |
| 741 | + # unclosed file pytest.EXE |
| 742 | + warnings.filterwarnings("ignore", category=ResourceWarning) |
| 743 | + testdir.inline_run( |
| 744 | + '--doctest-plus', '--doctest-rst', '--ignore', 'bar.py' |
| 745 | + ).assertoutcome(passed=2) |
| 746 | + else: |
| 747 | + testdir.inline_run( |
| 748 | + '--doctest-plus', '--doctest-rst', '--ignore', 'bar.py' |
| 749 | + ).assertoutcome(passed=2) |
740 | 750 |
|
741 | 751 |
|
742 | 752 | def test_ignore_glob_option(testdir): |
|
0 commit comments