Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6fd1ea3

Browse files
committed
Hide stderr output from subprocess call in test suite.
Otherwise the (irrelevant and slightly confusing) traceback gets displayed when running `pytest -s`.
1 parent e6fd901 commit 6fd1ea3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/tests/test_rcparams.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,11 @@ def test_backend_fallback_headless(tmpdir):
481481
with pytest.raises(subprocess.CalledProcessError):
482482
subprocess.run(
483483
[sys.executable, "-c",
484-
("import matplotlib;" +
485-
"matplotlib.use('tkagg');" +
486-
"import matplotlib.pyplot")
484+
"import matplotlib;"
485+
"matplotlib.use('tkagg');"
486+
"import matplotlib.pyplot"
487487
],
488-
env=env, check=True)
488+
env=env, check=True, stderr=subprocess.DEVNULL)
489489

490490

491491
@pytest.mark.skipif(

0 commit comments

Comments
 (0)