8000 Added tests/test_data folder and related changes · matplotlib/matplotlib@e024508 · GitHub
[go: up one dir, main page]

Skip to content

Commit e024508

Browse files
Added tests/test_data folder and related changes
1 parent d76a70c commit e024508

File tree

77 files changed

+8
-8
lines changed

Some content is hidden

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

77 files changed

+8
-8
lines changed

lib/matplotlib/tests/test_dviread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def test_PsfontsMap(monkeypatch):
1010
monkeypatch.setattr(dr, 'find_tex_file', lambda x: x)
1111

12-
filename = str(Path(__file__).parent / 'baseline_images/dviread/test.map')
12+
filename = str(Path(__file__).parent / 'test_data/dviread/test.map')
1313
fontmap = dr.PsfontsMap(filename)
1414
# Check all properties of a few fonts
1515
for n in [1, 2, 3, 4, 5]:
@@ -51,7 +51,7 @@ def test_PsfontsMap(monkeypatch):
5151
@pytest.mark.skipif(shutil.which("kpsewhich") is None,
5252
reason="kpsewhich is not available")
5353
def test_dviread():
54-
dirpath = Path(__file__).parent / 'baseline_images/dviread'
54+
dirpath = Path(__file__).parent / 'test_data/dviread'
5555
with (dirpath / 'test.json').open() as f:
5656
correct = json.load(f)
5757
with dr.Dvi(str(dirpath / 'test.dvi'), None) as dvi:

lib/matplotlib/tests/test_image.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def test_imshow_zoom(fig_test, fig_ref):
148148
@check_figures_equal()
149149
def test_imshow_pil(fig_test, fig_ref):
150150
style.use("default")
151-
png_path = Path(__file__).parent / "baseline_images/pngsuite/basn3p04.png"
152-
tiff_path = Path(__file__).parent / "baseline_images/test_image/uint16.tif"
151+
png_path = Path(__file__).parent / "test_data/pngsuite/basn3p04.png"
152+
tiff_path = Path(__file__).parent / "test_data/test_image/uint16.tif"
153153
axs = fig_test.subplots(2)
154154
axs[0].imshow(Image.open(png_path))
155155
axs[1].imshow(Image.open(tiff_path))
@@ -160,14 +160,14 @@ def test_imshow_pil(fig_test, fig_ref):
160160

161161
def test_imread_pil_uint16():
162162
img = plt.imread(os.path.join(os.path.dirname(__file__),
163-
'baseline_images', 'test_image', 'uint16.tif'))
163+
'test_data', 'test_image', 'uint16.tif'))
164164
assert img.dtype == np.uint16
165165
assert np.sum(img) == 134184960
166166

167167

168168
def test_imread_fspath():
169169
img = plt.imread(
170-
Path(__file__).parent / 'baseline_images/test_image/uint16.tif')
170+
Path(__file__).parent / 'test_data/test_image/uint16.tif')
171171
assert img.dtype == np.uint16
172172
assert np.sum(img) == 134184960
173173

@@ -713,7 +713,7 @@ def test_minimized_rasterized():
713713

714714

715715
def test_load_from_url():
716-
path = Path(__file__).parent / "baseline_images/pngsuite/basn3p04.png"
716+
path = Path(__file__).parent / "test_data/pngsuite/basn3p04.png"
717717
url = ('file:'
718718
+ ('///' if sys.platform == 'win32' else '')
719719
+ path.resolve().as_posix())

lib/matplotlib/tests/test_png.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@image_comparison(['pngsuite.png'], tol=0.03)
1212
def test_pngsuite():
1313
files = sorted(
14-
(Path(__file__).parent / "baseline_images/pngsuite").glob("basn*.png"))
14+
(Path(__file__).parent / "test_data/pngsuite").glob("basn*.png"))
1515

1616
plt.figure(figsize=(len(files), 2))
1717

0 commit comments

Comments
 (0)
0