summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2022-11-22 00:14:16 +0100
committerGitHub <noreply@github.com>2022-11-22 00:14:16 +0100
commitcc53ac660a629d9f14b1111e8106bee8bb5be6e9 (patch)
tree14f16d98601ba7391b79bdefd52d61c187204b0c
parent2752ead7b1db5895064f9bb72f81e6e928fcaf7c (diff)
parented6decde6114988606f53d2a69e48afb5316cd77 (diff)
Merge pull request #745 from mglisse/pytest-warns-none
pytest.warns(None) deprecated
-rw-r--r--src/python/test/test_persistence_graphical_tools.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/python/test/test_persistence_graphical_tools.py b/src/python/test/test_persistence_graphical_tools.py
index c19836b7..0e2ac3f8 100644
--- a/src/python/test/test_persistence_graphical_tools.py
+++ b/src/python/test/test_persistence_graphical_tools.py
@@ -12,6 +12,7 @@ import gudhi as gd
import numpy as np
import matplotlib as plt
import pytest
+import warnings
def test_array_handler():
@@ -71,13 +72,13 @@ def test_limit_to_max_intervals():
(0, (0.0, 0.106382)),
]
# check no warnings if max_intervals equals to the diagrams number
- with pytest.warns(None) as record:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
truncated_diags = gd.persistence_graphical_tools._limit_to_max_intervals(
diags, 10, key=lambda life_time: life_time[1][1] - life_time[1][0]
)
# check diagrams are not sorted
assert truncated_diags == diags
- assert len(record) == 0
# check warning if max_intervals lower than the diagrams number
with pytest.warns(UserWarning) as record: