File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,16 @@ jobs:
45
45
uses : actions/setup-python@v2
46
46
with :
47
47
python-version : ${{ matrix.python-version }}
48
+ - name : Install udunits
49
+ run : sudo apt-get install -y libudunits2-dev
48
50
- name : Run image
49
51
50
52
with :
51
53
poetry-version : ${{ matrix.poetry-version }}
52
54
- name : Install dependencies
53
55
run : |
54
56
poetry install
57
+ poetry run pip install cf_units==3.0.1
55
58
- name : Test with pytest
56
59
run : |
57
60
poetry run pytest gsw_xarray/tests
Original file line number Diff line number Diff line change @@ -28,3 +28,18 @@ def test_unit_pint(func_name):
28
28
for a in attrs :
29
29
print (a ["units" ])
30
30
ureg .Unit (a ["units" ])
31
+
32
+ @pytest .mark .parametrize ("func_name" , gsw_base )
33
+ def test_unit_cf_units (func_name ):
34
+ cf_units = pytest .importorskip ("cf_units" )
35
+ if func_name in ["indexer" , "match_args_return" , "pchip_interp" ]:
36
+ # Internal gsw cookery or non wrapped functions
37
+ return
38
+ attrs = _func_attrs [func_name ]
39
+ if isinstance (attrs , dict ):
40
+ attrs = [
41
+ attrs ,
42
+ ]
43
+ for a in attrs :
44
+ print (a ["units" ])
45
+ cf_units .Unit (a ["units" ])
You can’t perform that action at this time.
0 commit comments