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

Skip to content

Commit 2aede99

Browse files
meeseeksmachinetimhoffm
authored andcommitted
Backport PR #12726: Fix test_non_gui_warning for Azure (and mplcairo). (#12731)
1 parent 896f1dd commit 2aede99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/tests/test_backend_bases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def test_get_default_filename(tmpdir):
5656

5757

5858
@pytest.mark.backend('pdf')
59-
@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ,
60-
reason="this test fails an azure for unknown reasons")
61-
def test_non_gui_warning():
59+
def test_non_gui_warning(monkeypatch):
6260
plt.subplots()
6361

62+
monkeypatch.setitem(os.environ, "DISPLAY", ":999")
63+
6464
with pytest.warns(UserWarning) as rec:
6565
plt.show()
6666
assert len(rec) == 1

0 commit comments

Comments
 (0)