diff --git a/tests/test_xarray.py b/tests/test_xarray.py index 003d2718516..5b06804a517 100644 --- a/tests/test_xarray.py +++ b/tests/test_xarray.py @@ -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):