TST: Catch fork failures and mark them as xfail instead of fail. · spha-code/matplotlib@db71b51 · GitHub
Skip to content

Commit db71b51

Browse files
committed
TST: Catch fork failures and mark them as xfail instead of fail.
Not a pass, but not the fault of the test. TST,BUG: Move pytest import to just before its use. Hopefully this fixes the doc builds. TST: Cygwin: Mark more fork failures as xfail. Not a pass, but not matplotlib's fault.
1 parent 302aca2 commit db71b51

4 files changed

Lines changed: 48 additions & 18 deletions

File tree

lib/matplotlib/testing/__init__.py

Lines changed: 17 additions & 10 deletions

lib/matplotlib/tests/test_preprocess_data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,12 @@ def test_data_parameter_replacement():
259259
"import matplotlib.pyplot as plt"
260260
)
261261
cmd = [sys.executable, "-c", program]
262-
completed_proc = subprocess.run(cmd, text=True, capture_output=True)
262+
try:
263+
completed_proc = subprocess.run(cmd, text=True, capture_output=True)
264+
except BlockingIOError:
265+
if sys.platform == "cygwin":
266+
pytest.xfail("Fork failure")
267+
raise
263268
assert 'data parameter docstring error' not in completed_proc.stderr
264269

265270

lib/matplotlib/tests/test_pyplot.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ def test_pyplot_up_to_date(tmpdir):
2020
plt_file = tmpdir.join('pyplot.py')
2121
plt_file.write_text(orig_contents, 'utf-8')
2222

23-
subprocess.run([sys.executable, str(gen_script), str(plt_file)],
24-
check=True)
23+
try:
24+
subprocess.run([sys.executable, str(gen_script), str(plt_file)],
25+
check=True)
26+
except BlockingIOError:
27+
if sys.platform == "cygwin":
28+
pytest.xfail("Fork failure")
29+
raise
2530
new_contents = plt_file.read_text('utf-8')
2631

2732
if orig_contents != new_contents:

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 18 additions & 5 deletions

0 commit comments

Comments
 (0)