diff --git a/lib/matplotlib/tests/__init__.py b/lib/matplotlib/tests/__init__.py index 51167288ca81..7c4c5e946b6b 100644 --- a/lib/matplotlib/tests/__init__.py +++ b/lib/matplotlib/tests/__init__.py @@ -1,9 +1,8 @@ -import os +from pathlib import Path -# Check that the test directories exist -if not os.path.exists(os.path.join( - os.path.dirname(__file__), 'baseline_images')): +# Check that the test directories exist. +if not (Path(__file__).parent / 'baseline_images').exists(): raise IOError( 'The baseline image directory does not exist. ' 'This is most likely because the test data is not installed. ' diff --git a/pytest.ini b/pytest.ini index fdad48c2e92f..bc59294e8bca 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,6 @@ [pytest] +minversion = 3.6 + testpaths = lib python_files = test_*.py