From 0a1a39044b5d3c99909a47c928b2137914de257a Mon Sep 17 00:00:00 2001 From: sroet Date: Tue, 15 Feb 2022 11:36:54 +0100 Subject: [PATCH] use new way of checking for errors --- contact_map/tests/test_contact_count.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contact_map/tests/test_contact_count.py b/contact_map/tests/test_contact_count.py index ab87a89..1924ed7 100644 --- a/contact_map/tests/test_contact_count.py +++ b/contact_map/tests/test_contact_count.py @@ -62,10 +62,9 @@ def test_plot_kwargs(self): @pytest.mark.skipif(not HAS_MATPLOTLIB, reason="Missing matplotlib") def test_pixel_warning(self): # This should not raise a warning (5*2>=10) - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter('error') self.atom_contacts.plot(figsize=(5, 5), dpi=2) - # See if no warning was raised - assert len(record) == 0 # Now raise the warning as 4*2 < 10 with pytest.warns(RuntimeWarning) as record: