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

Skip to content

Commit 7869f0e

Browse files
committed
Fail hard and fast if the testing data is missing
1 parent e4ec9d5 commit 7869f0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/matplotlib/tests/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22
from matplotlib import rcParams, rcdefaults, use
33

44
import difflib
5+
import os
56

67
from matplotlib import rcParams, rcdefaults, use
78

89

910
_multiprocess_can_split_ = True
1011

1112

13+
# Check that the test directories exist
14+
if not os.path.exists(os.path.join(
15+
os.path.dirname(__file__), 'baseline_images')):
16+
raise IOError(
17+
'The baseline image directory does not exist. '
18+
'This is most likely because the test data is not installed. '
19+
'You may need to install matplotlib from source to get the '
20+
'test data.')
21+
22+
1223
def setup():
1324
# The baseline images are created in this locale, so we should use
1425
# it during all of the tests.

0 commit comments

Comments
 (0)