Skip to content

Commit

Permalink
better tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiisoup committed Aug 8, 2020
1 parent 65381f3 commit 7e1fbf8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions xarray/tests/test_dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -6178,8 +6178,16 @@ def test_rolling_iter(da):
actual.values[actual.values.nonzero()],
expected.values[expected.values.nonzero()],
)
# no error
repr(rolling_obj)


@pytest.mark.parametrize("da", (1,), indirect=True)
def test_rolling_repr(da):
rolling_obj = da.rolling(time=7)
assert repr(rolling_obj) == "DataArrayRolling [time->7]"
rolling_obj = da.rolling(time=7, center=True)
assert repr(rolling_obj) == "DataArrayRolling [time->7(center)]"
rolling_obj = da.rolling(time=7, x=3, center=True)
assert repr(rolling_obj) == "DataArrayRolling [time->7(center),x->3(center)]"


def test_rolling_doc(da):
Expand Down

0 comments on commit 7e1fbf8

Please sign in to comment.