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:
244
244
""" Test function `esmvalcore.preprocessor.example_preprocessor_function`."""
245
245
from pathlib import Path
246
246
247
- import esmvaltool_sample_data
248
247
import iris
249
248
import pytest
250
249
251
250
from esmvalcore.preprocessor import example_preprocessor_function
252
251
252
+ esmvaltool_sample_data = pytest.importorskip(" esmvaltool_sample_data" )
253
+
253
254
254
255
@pytest.mark.use_sample_data
255
256
def test_example_preprocessor_function ():
Original file line number Diff line number Diff line change 4
4
import tempfile
5
5
import unittest
6
6
import warnings
7
+ from importlib .resources import files as importlib_files
7
8
from pathlib import Path
8
9
9
10
import iris
10
11
import numpy as np
11
12
from iris .coords import DimCoord
12
13
from iris .cube import Cube , CubeList
13
14
14
- import esmvalcore
15
15
from esmvalcore .preprocessor ._io import load
16
16
17
17
@@ -56,12 +56,11 @@ def test_load(self):
56
56
57
57
def test_load_grib (self ):
58
58
"""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"
65
64
)
66
65
cubes = load (grib_path )
67
66
You can’t perform that action at this time.
0 commit comments