File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 33This module aims at testing the correct behavior of the Variables class.
44"""
55
6+ import sys
67import warnings
78from 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 )
You can’t perform that action at this time.
0 commit comments