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: