Skip to content

Commit 37fc5e5

Browse files
authored
Merge pull request #43 from cadenmyers13/tests
Surpress RuntimeWarning in test
2 parents 13a41a5 + b7aca2e commit 37fc5e5

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

news/test.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* Surpress `RuntimeWarning` in tests for the `applycutoff` function
20+
21+
**Security:**
22+
23+
* <news item>

tests/integration_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
import warnings
23

34
import h5py
45
import numpy as np
@@ -105,7 +106,9 @@ def test_applycutoff_range1(self):
105106
self.test_gui.qmaxentry.insert(0, "40")
106107

107108
# when
108-
self.test_gui.applycutoff()
109+
with warnings.catch_warnings():
110+
warnings.simplefilter("ignore", category=RuntimeWarning)
111+
self.test_gui.applycutoff()
109112
result = self.test_gui.cube
110113

111114
# then
@@ -119,7 +122,9 @@ def test_applycutoff_range2(self):
119122
self.test_gui.qmaxentry.insert(0, "35")
120123

121124
# when
122-
self.test_gui.applycutoff()
125+
with warnings.catch_warnings():
126+
warnings.simplefilter("ignore", category=RuntimeWarning)
127+
self.test_gui.applycutoff()
123128
result = self.test_gui.cube
124129

125130
# then

0 commit comments

Comments
 (0)