Skip to content

Commit ffcd124

Browse files
committed
test_postprocessing: add test for nonstr varname
this seemed like the "correct" way of handling the coverage problem
1 parent dae5a51 commit ffcd124

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_postprocessing.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,16 @@ def test_dataset_dont_touch():
140140
def test_autorecenter_spurious_renames(test_dataset_dont_touch):
141141
pscpy.auto_recenter(test_dataset_dont_touch, "cc", x="pad")
142142
assert np.array_equal(test_dataset_dont_touch.dont_touch, [0, 1, 2])
143+
144+
145+
@pytest.fixture
146+
def test_dataset_nonstr_varname():
147+
coords = [[0, 1, 2]]
148+
dims = ["x"]
149+
one = xr.DataArray([0, 1, 2], coords, dims)
150+
return xr.Dataset({1: one})
151+
152+
153+
def test_nonstr_varname(test_dataset_nonstr_varname):
154+
pscpy.auto_recenter(test_dataset_nonstr_varname, "nc", x="pad")
155+
assert np.array_equal(test_dataset_nonstr_varname[1], [0, 1, 2])

0 commit comments

Comments
 (0)