Skip to content

Commit

Permalink
Fix typing issues in tests (#8312)
Browse files Browse the repository at this point in the history
* Fix typing issues in tests

* Update test_variable.py
  • Loading branch information
Illviljan authored Oct 16, 2023
1 parent bac1265 commit 014ab81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions xarray/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def test_lazily_indexed_array(self) -> None:
assert expected.shape == actual.shape
assert_array_equal(expected, actual)
assert isinstance(actual._data, indexing.LazilyIndexedArray)
assert isinstance(v_lazy._data, indexing.LazilyIndexedArray)

# make sure actual.key is appropriate type
if all(
Expand Down
2 changes: 2 additions & 0 deletions xarray/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,7 @@ def test_datetime_conversion_warning(values, warns_under_pandas_version_two) ->
# The only case where a non-datetime64 dtype can occur currently is in
# the case that the variable is backed by a timezone-aware
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
assert isinstance(var._data, PandasIndexingAdapter)
assert var._data.array.dtype == pd.DatetimeTZDtype(
"ns", pytz.timezone("America/New_York")
)
Expand Down Expand Up @@ -2978,6 +2979,7 @@ def test_pandas_two_only_datetime_conversion_warnings() -> None:
# The only case where a non-datetime64 dtype can occur currently is in
# the case that the variable is backed by a timezone-aware
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
assert isinstance(var._data, PandasIndexingAdapter)
assert var._data.array.dtype == pd.DatetimeTZDtype(
"ns", pytz.timezone("America/New_York")
)
Expand Down

0 comments on commit 014ab81

Please sign in to comment.