|
1 | 1 | # stdlib |
2 | 2 | import os |
| 3 | +import platform |
3 | 4 | import sys |
4 | 5 | from typing import List |
5 | 6 |
|
|
24 | 25 | baseline_dir = str(PathPlus(__file__).parent / "baseline") |
25 | 26 | assert os.path.exists(baseline_dir) |
26 | 27 |
|
27 | | -if sys.version_info[:2] == (3, 7): |
28 | | - image_hashes = str(PathPlus(__file__).parent / "image_hashes_37.json") |
29 | | -elif sys.version_info[:2] == (3, 8): |
30 | | - image_hashes = str(PathPlus(__file__).parent / "image_hashes_38.json") |
31 | | -elif sys.version_info[:2] == (3, 9): |
32 | | - image_hashes = str(PathPlus(__file__).parent / "image_hashes_39.json") |
| 28 | +if platform.system == "Linux": |
| 29 | + if sys.version_info[:2] == (3, 7): |
| 30 | + image_hashes = str(PathPlus(__file__).parent / "image_hashes_37.json") |
| 31 | + elif sys.version_info[:2] == (3, 8): |
| 32 | + image_hashes = str(PathPlus(__file__).parent / "image_hashes_38.json") |
| 33 | + elif sys.version_info[:2] == (3, 9): |
| 34 | + image_hashes = str(PathPlus(__file__).parent / "image_hashes_39.json") |
| 35 | + else: |
| 36 | + image_hashes = str(PathPlus(__file__).parent / "image_hashes.json") |
| 37 | + |
| 38 | + check_images = pytest.mark.mpl_image_compare( |
| 39 | + baseline_dir=baseline_dir, |
| 40 | + savefig_kwargs={"dpi": 600}, |
| 41 | + hash_library=image_hashes, |
| 42 | + style="default", |
| 43 | + ) |
33 | 44 | else: |
34 | | - image_hashes = str(PathPlus(__file__).parent / "image_hashes.json") |
35 | | - |
36 | | -check_images = pytest.mark.mpl_image_compare( |
37 | | - baseline_dir=baseline_dir, |
38 | | - savefig_kwargs={"dpi": 600}, |
39 | | - hash_library=image_hashes, |
40 | | - style="default", |
41 | | - ) |
42 | | - |
| 45 | + check_images = pytest.mark.mpl_image_compare( |
| 46 | + baseline_dir=baseline_dir, |
| 47 | + savefig_kwargs={"dpi": 600}, |
| 48 | + style="default", |
| 49 | + ) |
43 | 50 |
|
44 | 51 | @check_images |
45 | 52 | def test_plot_ic(im_i: IntensityMatrix): |
|
0 commit comments