8000 Check deps in matplotlib.test() · matplotlib/matplotlib@33493f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 33493f7

Browse files
committed
Check deps in matplotlib.test()
And print an informative message
1 parent 2fe7715 commit 33493f7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,8 +1449,21 @@ def tk_window_focus():
14491449
]
14501450

14511451

1452+
def verify_test_dependencies():
1453+
try:
1454+
import nose
1455+
try:
1456+
from unittest import mock
1457+
except:
1458+
import mock
1459+
except ImportError:
1460+
print("matplotlib.test requires nose and mock to run.")
1461+
raise
1462+
1463+
14521464
def test(verbosity=1):
14531465
"""run the matplotlib test suite"""
1466+
verify_test_dependencies()
14541467
try:
14551468
import faulthandler
14561469
except ImportError:

0 commit comments

Comments
 (0)
0