|
12 | 12 | import matplotlib.testing.compare |
13 | 13 | from matplotlib import pyplot as plt |
14 | 14 | from matplotlib.testing._markers import needs_ghostscript, needs_usetex |
| 15 | +from matplotlib.testing import subprocess_run_for_testing |
15 | 16 |
|
16 | 17 |
|
17 | 18 | def _save_figure(objects='mhi', fmt="pdf", usetex=False): |
@@ -89,12 +90,13 @@ def test_determinism_check(objects, fmt, usetex): |
89 | 90 | Output format. |
90 | 91 | """ |
91 | 92 | plots = [ |
92 | | - subprocess.check_output( |
| 93 | + subprocess_run_for_testing( |
93 | 94 | [sys.executable, "-R", "-c", |
94 | 95 | f"from matplotlib.tests.test_determinism import _save_figure;" |
95 | 96 | f"_save_figure({objects!r}, {fmt!r}, {usetex})"], |
96 | 97 | env={**os.environ, "SOURCE_DATE_EPOCH": "946684800", |
97 | | - "MPLBACKEND": "Agg"}) |
| 98 | + "MPLBACKEND": "Agg"}, |
| 99 | + text=False, capture_output=True, check=True).stdout |
98 | 100 | for _ in range(3) |
99 | 101 | ] |
100 | 102 | for p in plots[1:]: |
@@ -129,10 +131,10 @@ def test_determinism_source_date_epoch(fmt, string): |
129 | 131 | string : bytes |
130 | 132 | Timestamp string for 2000-01-01 00:00 UTC. |
131 | 133 | """ |
132 | | - buf = subprocess.check_output( |
| 134 | + buf = subprocess_run_for_testing( |
133 | 135 | [sys.executable, "-R", "-c", |
134 | 136 | f"from matplotlib.tests.test_determinism import _save_figure; " |
135 | 137 | f"_save_figure('', {fmt!r})"], |
136 | 138 | env={**os.environ, "SOURCE_DATE_EPOCH": "946684800", |
137 | | - "MPLBACKEND": "Agg"}) |
| 139 | + "MPLBACKEND": "Agg"}, capture_output=True, text=False, check=True).stdout |
138 | 140 | assert string in buf |
0 commit comments