From f0dbd8d7b76ac217df3641d03997b393c476d77c Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 20 Nov 2019 15:58:04 -0500 Subject: [PATCH] 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. Signed-off-by: Elliott Sales de Andrade --- lib/matplotlib/tests/test_backend_webagg.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/tests/test_backend_webagg.py b/lib/matplotlib/tests/test_backend_webagg.py index 220670aa4..997c36a3a 100644 --- a/lib/matplotlib/tests/test_backend_webagg.py +++ b/lib/matplotlib/tests/test_backend_webagg.py @@ -8,11 +8,9 @@ import pytest def test_webagg_fallback(backend): if backend == "nbagg": pytest.importorskip("IPython") - env = {} - if os.name == "nt": - env = dict(os.environ) - else: - env = {"DISPLAY": ""} + env = dict(os.environ) + if os.name != "nt": + env["DISPLAY"] = "" env["MPLBACKEND"] = backend -- 2.21.0