File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
tests/integration/preprocessor/_io Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -244,12 +244,13 @@ and add the following content:
244244 """ Test function `esmvalcore.preprocessor.example_preprocessor_function`."""
245245 from pathlib import Path
246246
247- import esmvaltool_sample_data
248247 import iris
249248 import pytest
250249
251250 from esmvalcore.preprocessor import example_preprocessor_function
252251
252+ esmvaltool_sample_data = pytest.importorskip(" esmvaltool_sample_data" )
253+
253254
254255 @pytest.mark.use_sample_data
255256 def test_example_preprocessor_function ():
Original file line number Diff line number Diff line change 44import tempfile
55import unittest
66import warnings
7+ from importlib .resources import files as importlib_files
78from pathlib import Path
89
910import iris
1011import numpy as np
1112from iris .coords import DimCoord
1213from iris .cube import Cube , CubeList
1314
14- import esmvalcore
1515from esmvalcore .preprocessor ._io import load
1616
1717
@@ -56,12 +56,11 @@ def test_load(self):
5656
5757 def test_load_grib (self ):
5858 """Test loading a grib file."""
59- grib_path = Path (
60- Path (esmvalcore .__file__ ).parents [1 ],
61- "tests" ,
62- "sample_data" ,
63- "iris-sample-data" ,
64- "polar_stereo.grib2" ,
59+ grib_path = (
60+ Path (importlib_files ("tests" ))
61+ / "sample_data"
62+ / "iris-sample-data"
63+ / "polar_stereo.grib2"
6564 )
6665 cubes = load (grib_path )
6766
You can’t perform that action at this time.
0 commit comments