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

Skip to content

Commit f0dbd8d

Browse files
committed
Fix env override in WebAgg backend test.
It's only necessary to override DISPLAY, not throw away the rest of the environment. Without the other environment variables, stuff like custom PYTHONPATH break in this test.
1 parent 70fb1a6 commit f0dbd8d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/tests/test_backend_webagg.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
def test_webagg_fallback(backend):
99
if backend == "nbagg":
1010
pytest.importorskip("IPython")
11-
env = {}
12-
if os.name == "nt":
13-
env = dict(os.environ)
14-
else:
15-
env = {"DISPLAY": ""}
11+
env = dict(os.environ)
12+
if os.name != "nt":
13+
env["DISPLAY"] = ""
1614

1715
env["MPLBACKEND"] = backend
1816

0 commit comments

Comments
 (0)