|
6 | 6 | import shutil
|
7 | 7 |
|
8 | 8 | from pathlib import Path
|
| 9 | +import sys |
9 | 10 | from typing import Any
|
10 | 11 | from typing import Dict
|
11 | 12 | from typing import Tuple
|
|
25 | 26 | from spectrafit.plugins.pkl_converter import ExportData
|
26 | 27 | from spectrafit.plugins.pkl_converter import PklConverter
|
27 | 28 | from spectrafit.plugins.pkl_visualizer import PklVisualizer
|
28 |
| -from spectrafit.plugins.pptx_converter import PPTXConverter |
29 |
| -from spectrafit.plugins.rixs_converter import RIXSConverter |
30 | 29 |
|
31 | 30 |
|
| 31 | +if sys.version_info >= (3, 9): |
| 32 | + from spectrafit.plugins.pptx_converter import PPTXConverter |
| 33 | + from spectrafit.plugins.rixs_converter import RIXSConverter |
| 34 | +else: |
| 35 | + pytest.mark.skip("Requires Python 3.9 or higher", allow_module_level=True) |
| 36 | + |
| 37 | + |
| 38 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
32 | 39 | class TestFileConverter:
|
33 | 40 | """Test the file converter plugin."""
|
34 | 41 |
|
@@ -301,6 +308,7 @@ def reference_dataframe() -> pd.DataFrame:
|
301 | 308 | )
|
302 | 309 |
|
303 | 310 |
|
| 311 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
304 | 312 | class TestDataConverter:
|
305 | 313 | """Test DataConverter class."""
|
306 | 314 |
|
@@ -512,6 +520,7 @@ def tmp_file_pkl_nested(
|
512 | 520 | return tmp_file
|
513 | 521 |
|
514 | 522 |
|
| 523 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
515 | 524 | class TestPklConverter:
|
516 | 525 | """Test PklConverter."""
|
517 | 526 |
|
@@ -686,6 +695,7 @@ def test_cmd_pkl_converter(
|
686 | 695 | )
|
687 | 696 |
|
688 | 697 |
|
| 698 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
689 | 699 | class TestPklAsGraph:
|
690 | 700 | """Test the pkl visualizer."""
|
691 | 701 |
|
@@ -803,6 +813,7 @@ def fixture_tmp_list_dict_rixs(
|
803 | 813 | return fname, keys
|
804 | 814 |
|
805 | 815 |
|
| 816 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
806 | 817 | class TestRixsConverter:
|
807 | 818 | """Test the rixs converter."""
|
808 | 819 |
|
@@ -859,7 +870,7 @@ def test_save(
|
859 | 870 | if export_format == "npy":
|
860 | 871 | data_npy = np.load(fname.parent / f"{fname.stem}.npy", allow_pickle=True)
|
861 | 872 | assert isinstance(data_npy, np.ndarray)
|
862 |
| - assert np.allclose(data_npy.item()[keys[0]], data[keys[0]]) |
| 873 | + assert np.allclose(data_npy.item()[keys[0]], data[keys[0]]) # type: ignore |
863 | 874 |
|
864 | 875 | if export_format == "npz":
|
865 | 876 | data_npz = np.load(fname.parent / f"{fname.stem}.npz", allow_pickle=True)
|
@@ -1039,6 +1050,7 @@ def test_cmd_pkl_converter(
|
1039 | 1050 | """
|
1040 | 1051 |
|
1041 | 1052 |
|
| 1053 | +@pytest.mark.skipif(sys.version_info < (3, 9), reason="Requires Python 3.9 or higher") |
1042 | 1054 | class TestPPTXConverter:
|
1043 | 1055 | """Test the pptx converter."""
|
1044 | 1056 |
|
|
0 commit comments