ci: fix pytest.warns type error
use warnings.catch_warnings to suppress instead https://docs.pytest.org/en/7.0.x/how-to/capture-warnings.html?highlight=warnings#additional-use-cases-of-warnings-in-tests likely due to pytest update to version 7
This commit is contained in:
parent
c4ad84ad95
commit
f78b12f005
1 changed files with 3 additions and 1 deletions
|
@ -161,7 +161,9 @@ def test_serialize_fallback() -> None:
|
||||||
# ignore warnings. depending on test order,
|
# ignore warnings. depending on test order,
|
||||||
# the lru_cache'd warning may have already been sent,
|
# the lru_cache'd warning may have already been sent,
|
||||||
# so checking may be nondeterministic?
|
# so checking may be nondeterministic?
|
||||||
with pytest.warns(None):
|
import warnings
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
res = jsn.loads(dumps(X))
|
res = jsn.loads(dumps(X))
|
||||||
assert res == [5, 5.0]
|
assert res == [5, 5.0]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue