Skip to content

Commit 7157312

Browse files
authored
Merge pull request #12975 from anntzer/pytest-version
TST: Fail-fast when trying to run tests with too-old pytest.
2 parents 345607a + 876becc commit 7157312

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/matplotlib/tests/__init__.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import os
1+
from pathlib import Path
22

33

4-
# Check that the test directories exist
5-
if not os.path.exists(os.path.join(
6-
os.path.dirname(__file__), 'baseline_images')):
4+
# Check that the test directories exist.
5+
if not (Path(__file__).parent / 'baseline_images').exists():
76
raise IOError(
87
'The baseline image directory does not exist. '
98
'This is most likely because the test data is not installed. '

pytest.ini

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[pytest]
2+
minversion = 3.6
3+
24
testpaths = lib
35
python_files = test_*.py
46

0 commit comments

Comments
 (0)