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

Skip to content

Commit f1bc933

Browse files
committed
Fix test_non_gui_warning for Azure (and mplcairo).
If on Linux and $DISPLAY is not set, then the non-gui warning is not emitted. We didn't notice that on Travis as $DISPLAY was indeed always set; but it's not on Azure.
1 parent 3bf9076 commit f1bc933

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
@@ -58,11 +58,11 @@ def test_get_default_filename(tmpdir):
5858

5959

6060
@pytest.mark.backend('pdf')
61-
@pytest.mark.skipif('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' in os.environ,
62-
reason="this test fails an azure for unknown reasons")
63-
def test_non_gui_warning():
61+
def test_non_gui_warning(monkeypatch):
6462
plt.subplots()
6563

64+
monkeypatch.setitem(os.environ, "DISPLAY", ":999")
65+
6666
with pytest.warns(UserWarning) as rec:
6767
plt.show()
6868
assert len(rec) == 1

0 commit comments

Comments
 (0)