Skip to content

Commit 959e9f3

Browse files
authored
Merge pull request #14158 from anntzer/test_lazy_imports
Fix test_lazy_imports in presence of $MPLBACKEND or matplotlibrc.
2 parents 28e32c6 + 0fae373 commit 959e9f3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/tests/test_basic.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import builtins
2+
import os
23
import subprocess
34
import sys
45
import textwrap
@@ -50,8 +51,6 @@ def test_lazy_imports():
5051
assert 'urllib.request' not in sys.modules
5152
""")
5253

53-
subprocess.check_call([
54-
sys.executable,
55-
'-c',
56-
source
57-
])
54+
subprocess.check_call(
55+
[sys.executable, '-c', source],
56+
env={**os.environ, "MPLBACKEND": "", "MATPLOTLIBRC": os.devnull})

0 commit comments

Comments
 (0)