Skip to content

Commit 014ab81

Browse files
authored
Fix typing issues in tests (#8312)
* Fix typing issues in tests * Update test_variable.py
1 parent bac1265 commit 014ab81

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

xarray/tests/test_indexing.py

+1
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ def test_lazily_indexed_array(self) -> None:
307307
assert expected.shape == actual.shape
308308
assert_array_equal(expected, actual)
309309
assert isinstance(actual._data, indexing.LazilyIndexedArray)
310+
assert isinstance(v_lazy._data, indexing.LazilyIndexedArray)
310311

311312
# make sure actual.key is appropriate type
312313
if all(

xarray/tests/test_variable.py

+2
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,7 @@ def test_datetime_conversion_warning(values, warns_under_pandas_version_two) ->
29452945
# The only case where a non-datetime64 dtype can occur currently is in
29462946
# the case that the variable is backed by a timezone-aware
29472947
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
2948+
assert isinstance(var._data, PandasIndexingAdapter)
29482949
assert var._data.array.dtype == pd.DatetimeTZDtype(
29492950
"ns", pytz.timezone("America/New_York")
29502951
)
@@ -2978,6 +2979,7 @@ def test_pandas_two_only_datetime_conversion_warnings() -> None:
29782979
# The only case where a non-datetime64 dtype can occur currently is in
29792980
# the case that the variable is backed by a timezone-aware
29802981
# DatetimeIndex, and thus is hidden within the PandasIndexingAdapter class.
2982+
assert isinstance(var._data, PandasIndexingAdapter)
29812983
assert var._data.array.dtype == pd.DatetimeTZDtype(
29822984
"ns", pytz.timezone("America/New_York")
29832985
)

0 commit comments

Comments
 (0)