diff --git a/tests/data/test_cf_units.py b/tests/data/test_cf_units.py index c6e5404f4c62edfe17e19496bc73bfb9cf35d660..8ad8833da24b7c45894483b4ad288eecc29bea5a 100644 --- a/tests/data/test_cf_units.py +++ b/tests/data/test_cf_units.py @@ -23,9 +23,11 @@ class TestCfUnits(unittest.TestCase): self.assertEqual(u("degC"), "°C") self.assertEqual(u("degree_Celsius"), "°C") - self.assertEqual(u(""), "1") - self.assertEqual(u("1"), "1") - self.assertEqual(u("m/m"), "1") + # "dimensionless" representation inconsistent across different pint versions + # will be "1" for newer versions (>=0.24.1) to be in line with cf-conventions + self.assertTrue(u("") in ("1", "dimensionless", "")) + self.assertTrue(u("1") in ("1", "dimensionless", "")) + self.assertTrue(u("m/m") in ("1", "dimensionless", "")) self.assertEqual(u("m/s"), "m s-1") self.assertEqual(u("m s-1"), "m s-1")