Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 833f48d

Browse filesBrowse files
committed
Fail-fast when trying to run tests with too-old pytest.
Otherwise the error message can be quite obscure.
1 parent d72f069 commit 833f48d
Copy full SHA for 833f48d

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed

‎lib/matplotlib/tests/__init__.py

Copy file name to clipboard
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import os
1+
from distutils.version import LooseVersion
2+
from pathlib import Path
23

4+
import pytest
35

4-
# Check that the test directories exist
5-
if not os.path.exists(os.path.join(
6-
os.path.dirname(__file__), 'baseline_images')):
6+
7+
# Check that the test directories exist.
8+
if not (Path(__file__).parent / 'baseline_images').exists():
79
raise IOError(
810
'The baseline image directory does not exist. '
911
'This is most likely because the test data is not installed. '
1012
'You may need to install matplotlib from source to get the '
1113
'test data.')
14+
if LooseVersion(pytest.__version__) < "3.6":
15+
raise RuntimeError('pytest>=3.6 is required to run the tests')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.