Skip to content

Commit

Permalink
MNT: Fix failing xarray with units test
Browse files Browse the repository at this point in the history
It's only by accident that this test even passed in the olden days
(because we were swallowing an AttributeError. This seems like the right
test for the actual expected functionality.
  • Loading branch information
dopplershift committed Aug 5, 2020
1 parent 033cf85 commit 8f739e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def test_convert_units(test_var):
assert units(test_var.attrs['units']) == units('degC')

# Make sure we now get an array back with properly converted values
assert test_var.metpy.unit_array.units == units.degC
assert_almost_equal(test_var[0, 0, 0, 0], 18.44 * units.degC, 2)
quant = test_var.metpy.unit_array
assert quant.units == units.degC
assert_almost_equal(quant[0, 0, 0, 0], 18.44 * units.degC, 2)


def test_convert_coordinate_units(test_ds_generic):
Expand Down

0 comments on commit 8f739e8

Please sign in to comment.