diff options
author | Gard Spreemann <gspr@nonempty.org> | 2023-01-20 13:51:54 +0100 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2023-01-20 13:51:54 +0100 |
commit | 58db7d48d3315d5b4112e2ceaeee8f8c137f9de1 (patch) | |
tree | a755190f4ab6a8a59b642f81ede39e14e7ae1811 /src/python/test/test_persistence_graphical_tools.py | |
parent | 966b33d9da2b8044c7abc111e7b80ce7c83afeaa (diff) | |
parent | 688cbc5c29d0a6aaf233eee185a06cef5cb2e745 (diff) |
Merge branch 'dfsg/latest' into debian/sid
Diffstat (limited to 'src/python/test/test_persistence_graphical_tools.py')
-rw-r--r-- | src/python/test/test_persistence_graphical_tools.py | 5 |
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: |