Skip to content

Commit b1c5ce1

Browse files
author
Robbie Muir
committed
add 3.10 support
1 parent af58a0d commit b1c5ce1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/test_variables.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This module aims at testing the correct behavior of the Variables class.
44
"""
55

6+
import sys
67
import warnings
78
from datetime import datetime
89

@@ -141,9 +142,14 @@ def test_timezone_alignment_with_multiplication() -> None:
141142
series1 = pd.Series(index=utc_index, data=1.0)
142143
var1 = model.add_variables(coords=[utc_index], name="var1")
143144

144-
with warnings.catch_warnings(category=CoordAlignWarning):
145-
warnings.simplefilter("error")
146-
expr = var1 * series1
145+
if sys.version_info >= (3, 11):
146+
with warnings.catch_warnings(category=CoordAlignWarning):
147+
warnings.simplefilter("error")
148+
expr = var1 * series1
149+
else:
150+
with warnings.catch_warnings():
151+
warnings.simplefilter("error")
152+
expr = var1 * series1
147153

148154
index: pd.DatetimeIndex = expr.coords["time"].to_index()
149155
assert index.equals(utc_index)

0 commit comments

Comments
 (0)