Skip to content

Commit 2949558

Browse files
guziyshoyer
authored andcommitted
Data vars in open mfdataset (#1623)
* make tests more explicit
1 parent 27132fb commit 2949558

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

xarray/tests/test_backends.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,19 +1340,10 @@ def test_common_coord_when_datavars_all(self):
13401340

13411341
var_shape = ds[self.var_name].shape
13421342

1343-
# shape pairs to be compared
1344-
shape_pairs = [
1345-
(var_shape, coord_shape),
1346-
(coord_shape1, coord_shape),
1347-
(coord_shape2, coord_shape)
1348-
]
1349-
# tests to be applied to respective pairs
1350-
tests = [self.assertEqual,
1351-
self.assertNotEqual, self.assertNotEqual]
1352-
1353-
for a_test, a_shape_pair in zip(tests, shape_pairs):
1354-
a_test(*a_shape_pair)
1355-
1343+
self.assertEqual(var_shape, coord_shape)
1344+
self.assertNotEqual(coord_shape1, coord_shape)
1345+
self.assertNotEqual(coord_shape2, coord_shape)
1346+
13561347
def test_common_coord_when_datavars_minimal(self):
13571348
opt = 'minimal'
13581349

@@ -1366,18 +1357,9 @@ def test_common_coord_when_datavars_minimal(self):
13661357

13671358
var_shape = ds[self.var_name].shape
13681359

1369-
# shape pairs to be compared
1370-
shape_pairs = [
1371-
(var_shape, coord_shape),
1372-
(coord_shape1, coord_shape),
1373-
(coord_shape2, coord_shape)
1374-
]
1375-
# tests to be applied to respective pairs
1376-
tests = [self.assertNotEqual,
1377-
self.assertEqual, self.assertEqual]
1378-
1379-
for a_test, a_shape_pair in zip(tests, shape_pairs):
1380-
a_test(*a_shape_pair)
1360+
self.assertNotEqual(var_shape, coord_shape)
1361+
self.assertEqual(coord_shape1, coord_shape)
1362+
self.assertEqual(coord_shape2, coord_shape)
13811363

13821364
def test_invalid_data_vars_value_should_fail(self):
13831365

0 commit comments

Comments
 (0)