From be29663514752e3cc075cc8d5986f2ba3c799a82 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 3 Nov 2018 23:50:19 -0400 Subject: [PATCH] Backport PR #12726: Fix test_non_gui_warning for Azure (and mplcairo). --- lib/matplotlib/tests/test_backend_bases.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_bases.py b/lib/matplotlib/tests/test_backend_bases.py index 676686b7b1da..a6d6e57696ac 100644 --- a/lib/matplotlib/tests/test_backend_bases.py +++ b/lib/matplotlib/tests/test_backend_bases.py @@ -56,11 +56,11 @@ def test_get_default_filename(tmpdir): @pytest.mark.backend('pdf') -@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ, - reason="this test fails an azure for unknown reasons") -def test_non_gui_warning(): +def test_non_gui_warning(monkeypatch): plt.subplots() + monkeypatch.setitem(os.environ, "DISPLAY", ":999") + with pytest.warns(UserWarning) as rec: plt.show() assert len(rec) == 1