Skip to content

Commit 255b751

Browse files
author
Ben Cipollini
committed
deprecation tests should actually test for warnings.
1 parent a6bacdb commit 255b751

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nibabel/gifti/tests/test_gifti.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ def test_labeltable():
9797
def test_metadata():
9898
# Test deprecation
9999
with clear_and_catch_warnings() as w:
100-
warnings.filterwarnings('once', category=DeprecationWarning)
100+
warnings.filterwarnings('always', category=DeprecationWarning)
101101
assert_equal(len(GiftiDataArray().get_metadata()), 0)
102+
assert_equal(len(w), 1)
102103

103104
# Test deprecation
104105
with clear_and_catch_warnings() as w:
105106
warnings.filterwarnings('once', category=DeprecationWarning)
106107
assert_equal(len(GiftiMetaData().get_metadata()), 0)
108+
assert_equal(len(w), 1)
107109

108110

109111
def test_gifti_label_rgba():
@@ -133,6 +135,7 @@ def assign_rgba(gl, val):
133135
with clear_and_catch_warnings() as w:
134136
warnings.filterwarnings('once', category=DeprecationWarning)
135137
assert_equal(kwargs['red'], gl3.get_rgba()[0])
138+
assert_equal(len(w), 1)
136139

137140
# Test default value
138141
gl4 = GiftiLabel()

0 commit comments

Comments
 (0)