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

Skip to content

Commit 8dfa3a0

Browse files
committed
Split toolkit tests into their toolkits
Conceptually, every subdirectory of `mpl_toolkits` is an independent thing (mostly, though `axisartist` does use parts of `axes_grid1`). It is thus strange for all the tests to be stuck together in a single `tests` directory. Additionally, this causes naming oddities such as using parts of file names as a pseudo-namespace (i.e., `test_axisartist_*`) when we already have a namespace, namely the directory that is the toolkit. As we add additional tests for the toolkits (mostly 3D, I mean), this will either cause the number of these oddities to grow, or else `test_mplot3d.py` will just become an extremely large file.
1 parent 231d1c8 commit 8dfa3a0

File tree

101 files changed

+30
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+30
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from pathlib import Path
2+
3+
4+
# Check that the test directories exist
5+
if not (Path(__file__).parent / "baseline_images").exists():
6+
raise IOError(
7+
'The baseline image directory does not exist. '
8+
'This is most likely because the test data is not installed. '
9+
'You may need to install matplotlib from source to get the '
10+
'test data.')
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from matplotlib.testing.conftest import (mpl_test_settings, # noqa
2+
pytest_configure, pytest_unconfigure)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from pathlib import Path
2+
3+
4+
# Check that the test directories exist
5+
if not (Path(__file__).parent / "baseline_images").exists():
6+
raise IOError(
7+
'The baseline image directory does not exist. '
8+
'This is most likely because the test data is not installed. '
9+
'You may need to install matplotlib from source to get the '
10+
'test data.')
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from matplotlib.testing.conftest import (mpl_test_settings, # noqa
2+
pytest_configure, pytest_unconfigure)

setupext.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,12 @@ def get_package_data(self):
487487
'tests/test_*.ipynb',
488488
],
489489
'mpl_toolkits': [
490-
*_pkg_data_helper('mpl_toolkits', 'tests/baseline_images'),
490+
*_pkg_data_helper('mpl_toolkits/axes_grid1',
491+
'tests/baseline_images'),
492+
*_pkg_data_helper('mpl_toolkits/axisartist'
493+
'tests/baseline_images'),
494+
*_pkg_data_helper('mpl_toolkits/mplot3d'
495+
'tests/baseline_images'),
491496
]
492497
}
493498

0 commit comments

Comments
 (0)