1
- import pytest
1
+ import pickle
2
+ import warnings
2
3
4
+ import pytest
3
5
try :
4
6
import pydantic # noqa: F401
5
7
except ImportError :
6
8
pytest .skip ("pydantic is required for testing Checked* classes" , allow_module_level = True )
7
-
8
- import pickle
9
9
import numpy as np
10
10
11
11
from larray import (CheckedSession , CheckedArray , Axis , AxisCollection , Group , Array ,
@@ -398,7 +398,12 @@ def _test_io_cs(tmp_path, meta, engine, ext):
398
398
cs = CheckedSessionExample ()
399
399
400
400
with must_warn (UserWarning , match = r"'\w' is not declared in 'CheckedSessionExample'" , num_expected = 3 ):
401
- cs .load (fpath , engine = engine )
401
+ with warnings .catch_warnings ():
402
+ warnings .filterwarnings ("ignore" ,
403
+ module = 'openpyxl' ,
404
+ message = r"datetime.datetime.utcnow\(\) is deprecated.*" )
405
+
406
+ cs .load (fpath , engine = engine )
402
407
403
408
# --- names ---
404
409
# we do not use keys() since order of undeclared variables
@@ -418,7 +423,12 @@ def _test_io_cs(tmp_path, meta, engine, ext):
418
423
e2 = ndtest ((a4 , 'b=b0..b2' ))
419
424
h2 = full_like (h , fill_value = 10 )
420
425
with must_warn (UserWarning , match = r"No value passed for the declared variable '\w+'" , num_expected = 3 ):
421
- CheckedSessionExample (a = a4 , a01 = a4_01 , e = e2 , h = h2 ).save (fpath , overwrite = False , engine = engine )
426
+ with warnings .catch_warnings ():
427
+ warnings .filterwarnings ("ignore" ,
428
+ module = r'openpyxl' ,
429
+ message = r"datetime.datetime.utcnow\(\) is deprecated.*" )
430
+
431
+ CheckedSessionExample (a = a4 , a01 = a4_01 , e = e2 , h = h2 ).save (fpath , overwrite = False , engine = engine )
422
432
with must_warn (UserWarning , match = r"No value passed for the declared variable '\w+'" , num_expected = 7 ):
423
433
cs = CheckedSessionExample ()
424
434
0 commit comments