()
| 29 | |
| 30 | |
| 31 | def test_lazy_imports(): |
| 32 | source = textwrap.dedent(""" |
| 33 | import sys |
| 34 | |
| 35 | import matplotlib.figure |
| 36 | import matplotlib.backend_bases |
| 37 | import matplotlib.pyplot |
| 38 | |
| 39 | assert 'matplotlib._tri' not in sys.modules |
| 40 | assert 'matplotlib._qhull' not in sys.modules |
| 41 | assert 'matplotlib._contour' not in sys.modules |
| 42 | assert 'urllib.request' not in sys.modules |
| 43 | """) |
| 44 | |
| 45 | subprocess_run_for_testing( |
| 46 | [sys.executable, '-c', source], |
| 47 | env={**os.environ, "MPLBACKEND": "", "MATPLOTLIBRC": os.devnull}, |
| 48 | check=True) |
nothing calls this directly
no test coverage detected
searching dependent graphs…