Skip to content

Commit 2fcb7a7

Browse files
committed
TST: fix unreliable warning test
Top level import does not do DeprecationWarning in the test when previously imported. Not worth to test for this.
1 parent a804ae8 commit 2fcb7a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/diffpy/structure/tests/testoldimports.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ def setUpClass(cls):
4141
def test_00TopImport(self):
4242
"""check import of diffpy.Structure
4343
"""
44-
with warnings.catch_warnings(record=True) as w:
45-
warnings.simplefilter('always', category=DeprecationWarning)
44+
with warnings.catch_warnings():
45+
warnings.simplefilter('ignore', category=DeprecationWarning)
4646
import diffpy.Structure as m0
47-
self.assertIs(DeprecationWarning, w[0].category)
4847
self.assertIs(diffpy.structure, m0)
4948
# second import should raise no warning
5049
with warnings.catch_warnings():

0 commit comments

Comments
 (0)