Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b4048c

Browse files
committed
Run subprocess-starting tests without pytest-xdist
I suspect that we are running out of process IDs, or the scheduleris not letting all subprocesses execute, leading to timeouts intests that start subprocesses when there are other tests executing.This happens often with Python 3.14 tests for some reason.
1 parentede1ebb commit8b4048c

15 files changed

+45
-7
lines changed

‎.github/workflows/tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,18 @@ jobs:
337337
if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then
338338
export PYTHON_GIL=0
339339
fi
340-
pytest -rfEsXR -n auto \
341-
--maxfail=50 --timeout=300 --durations=25 \
342-
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
340+
FLAGS=(
341+
-rfEsXR
342+
--maxfail=50
343+
--timeout=300
344+
--durations=25
345+
--cov-report=xml
346+
--cov=lib
347+
--log-level=DEBUG
348+
--color=yes
349+
)
350+
pytest "${FLAGS[@]}" -m 'not subprocess' -n auto
351+
pytest "${FLAGS[@]}" -m subprocess
343352
344353
-name:Cleanup non-failed image files
345354
if:failure()

‎azure-pipelines.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,18 @@ stages:
120120
121121
echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
122122
123-
PYTHONFAULTHANDLER=1 pytest -rfEsXR -n 2 \
124-
--maxfail=50 --timeout=300 --durations=25 \
125-
--junitxml=junit/test-results.xml --cov-report=xml --cov=lib
123+
FLAGS=(
124+
-rfEsXR
125+
--maxfail=50
126+
--timeout=300
127+
--durations=25
128+
--cov-report=xml
129+
--cov=lib
130+
)
131+
PYTHONFAULTHANDLER=1 pytest "${FLAGS[@]}" -m 'not subprocess' -n 2 \
132+
--junitxml=junit/test-results-1.xml
133+
PYTHONFAULTHANDLER=1 pytest "${FLAGS[@]}" -m subprocess \
134+
--junitxml=junit/test-results-2.xml
126135
127136
if [[ $VS_VER == 2022 ]]; then
128137
"$TOOL" shutdown $SESSION_ID
@@ -153,7 +162,8 @@ stages:
153162
154163
-task:PublishTestResults@2
155164
inputs:
156-
testResultsFiles:'**/test-results.xml'
165+
mergeTestResults:true
166+
testResultsFiles:'**/test-results*.xml'
157167
testRunTitle:'Python $(python.version)'
158168
condition:succeededOrFailed()
159169

‎lib/matplotlib/testing/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def pytest_configure(config):
1515
("markers","backend: Set alternate Matplotlib backend temporarily."),
1616
("markers","baseline_images: Compare output against references."),
1717
("markers","pytz: Tests that require pytz to be installed."),
18+
("markers","subprocess: Tests that start a subprocess."),
1819
("filterwarnings","error"),
1920
("filterwarnings",
2021
"ignore:.*The py23 module has been deprecated:DeprecationWarning"),

‎lib/matplotlib/tests/test_backend_inline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
pytest.importorskip('matplotlib_inline')
1313

1414

15+
@pytest.mark.subprocess
1516
deftest_ipynb():
1617
nb_path=Path(__file__).parent/'data/test_inline_01.ipynb'
1718

‎lib/matplotlib/tests/test_backend_nbagg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# From https://blog.thedataincubator.com/2016/06/testing-jupyter-notebooks/
1414

1515

16+
@pytest.mark.subprocess
1617
deftest_ipynb():
1718
nb_path=Path(__file__).parent/'data/test_nbagg_01.ipynb'
1819

‎lib/matplotlib/tests/test_backend_webagg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
frommatplotlib.testingimportsubprocess_run_for_testing
77

88

9+
@pytest.mark.subprocess
910
@pytest.mark.parametrize("backend", ["webagg","nbagg"])
1011
deftest_webagg_fallback(backend):
1112
pytest.importorskip("tornado")

‎lib/matplotlib/tests/test_basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
frommatplotlib.testingimportsubprocess_run_for_testing
77

8+
importpytest
9+
810

911
deftest_simple():
1012
assert1+1==2
@@ -28,6 +30,7 @@ def test_override_builtins():
2830
assertoverridden<=ok_to_override
2931

3032

33+
@pytest.mark.subprocess
3134
deftest_lazy_imports():
3235
source=textwrap.dedent("""
3336
import sys

‎lib/matplotlib/tests/test_determinism.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def draw(self, renderer=None):
139139
fig.savefig(stdout,format=fmt)
140140

141141

142+
@pytest.mark.subprocess
142143
@pytest.mark.parametrize(
143144
"objects, fmt, usetex", [
144145
("","pdf",False),
@@ -185,6 +186,7 @@ def test_determinism_check(objects, fmt, usetex):
185186
assertp==plots[0]
186187

187188

189+
@pytest.mark.subprocess
188190
@pytest.mark.parametrize(
189191
"fmt, string", [
190192
("pdf",b"/CreationDate (D:20000101000000Z)"),

‎lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ def test_fontcache_thread_safe():
288288
subprocess_run_helper(_test_threading,timeout=10)
289289

290290

291+
@pytest.mark.subprocess
291292
deftest_lockfilefailure(tmp_path):
292293
# The logic here:
293294
# 1. get a temp directory from pytest

‎lib/matplotlib/tests/test_matplotlib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def test_parse_to_version_info(version_str, version_tuple):
1919
assertmatplotlib._parse_to_version_info(version_str)==version_tuple
2020

2121

22+
@pytest.mark.subprocess
2223
@pytest.mark.skipif(sys.platform=="win32",
2324
reason="chmod() doesn't work as is on Windows")
2425
@pytest.mark.skipif(sys.platform!="win32"andos.geteuid()==0,
@@ -37,6 +38,7 @@ def test_tmpconfigdir_warning(tmp_path):
3738
os.chmod(tmp_path,mode)
3839

3940

41+
@pytest.mark.subprocess
4042
deftest_importable_with_no_home(tmp_path):
4143
subprocess_run_for_testing(
4244
[sys.executable,"-c",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp