Skip to content

Commit 14715ed

Browse files
Try alternative pandas test fix
1 parent 1144106 commit 14715ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pvlib/tests/test_tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,11 @@ def test_normalize_max2one(data_in, expected):
274274
def test_localize_to_utc(input, expected):
275275
got = tools.localize_to_utc(**input)
276276

277-
# Pandas has wonky dtype check in Python 3.9.
278277
if isinstance(got, (pd.Series, pd.DataFrame)):
279-
pd.testing.assert_index_equal(got.index, expected.index)
278+
# Older pandas versions have wonky dtype check on index.
279+
for index_got, index_expected in zip(got.index, expected.index):
280+
assert index_got == index_expected
281+
280282
np.testing.assert_array_equal(got.to_numpy(), expected.to_numpy())
281283
else:
282284
assert got == expected

0 commit comments

Comments
 (0)