diff --git a/news/test.rst b/news/test.rst index 225407f..dcd07f1 100644 --- a/news/test.rst +++ b/news/test.rst @@ -16,7 +16,7 @@ **Fixed:** -* Surpress `RuntimeWarning` in tests for the `applycutoff` function +* Surpress the `RuntimeWarning` in tests for the `applycutoff` function **Security:** diff --git a/tests/integration_test.py b/tests/integration_test.py index f9cb74a..214ce22 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -105,9 +105,12 @@ def test_applycutoff_range1(self): self.test_gui.qminentry.insert(0, "10") self.test_gui.qmaxentry.insert(0, "40") - # when + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) + # when self.test_gui.applycutoff() result = self.test_gui.cube @@ -121,9 +124,12 @@ def test_applycutoff_range2(self): self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - # when + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) + # when self.test_gui.applycutoff() result = self.test_gui.cube