diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index a0b70373408..e1a75c86a97 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -1340,19 +1340,10 @@ def test_common_coord_when_datavars_all(self): var_shape = ds[self.var_name].shape - # shape pairs to be compared - shape_pairs = [ - (var_shape, coord_shape), - (coord_shape1, coord_shape), - (coord_shape2, coord_shape) - ] - # tests to be applied to respective pairs - tests = [self.assertEqual, - self.assertNotEqual, self.assertNotEqual] - - for a_test, a_shape_pair in zip(tests, shape_pairs): - a_test(*a_shape_pair) - + self.assertEqual(var_shape, coord_shape) + self.assertNotEqual(coord_shape1, coord_shape) + self.assertNotEqual(coord_shape2, coord_shape) + def test_common_coord_when_datavars_minimal(self): opt = 'minimal' @@ -1366,18 +1357,9 @@ def test_common_coord_when_datavars_minimal(self): var_shape = ds[self.var_name].shape - # shape pairs to be compared - shape_pairs = [ - (var_shape, coord_shape), - (coord_shape1, coord_shape), - (coord_shape2, coord_shape) - ] - # tests to be applied to respective pairs - tests = [self.assertNotEqual, - self.assertEqual, self.assertEqual] - - for a_test, a_shape_pair in zip(tests, shape_pairs): - a_test(*a_shape_pair) + self.assertNotEqual(var_shape, coord_shape) + self.assertEqual(coord_shape1, coord_shape) + self.assertEqual(coord_shape2, coord_shape) def test_invalid_data_vars_value_should_fail(self):