Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion news/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

**Fixed:**

* Surpress `RuntimeWarning` in tests for the `applycutoff` function
* Surpress the `RuntimeWarning` in tests for the `applycutoff` function

**Security:**

Expand Down
10 changes: 8 additions & 2 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down