14
14
('1.0.0' , [('nibabel' , 'neverexisted' )]),
15
15
]
16
16
17
+ ATTRIBUTE_SCHEDULE = [
18
+ ('5.0.0' , [('nibabel.dataobj_images' , 'DataobjImage' , 'get_data' )]),
19
+ # Verify that the test will be quiet if the schedule outlives the modules
20
+ ('1.0.0' , [('nibabel' , 'Nifti1Image' , 'neverexisted' )]),
21
+ ]
22
+
17
23
18
24
def test_module_removal ():
19
25
for version , to_remove in MODULE_SCHEDULE :
@@ -32,3 +38,19 @@ def test_object_removal():
32
38
except ImportError :
33
39
continue
34
40
assert_false (hasattr (module , obj ), msg = "Time to remove %s.%s" % (module_name , obj ))
41
+
42
+
43
+ def test_attribute_removal ():
44
+ for version , to_remove in ATTRIBUTE_SCHEDULE :
45
+ if cmp_pkg_version (version ) < 1 :
46
+ for module_name , cls , attr in to_remove :
47
+ try :
48
+ module = __import__ (module_name )
49
+ except ImportError :
50
+ continue
51
+ try :
52
+ klass = getattr (module , cls )
53
+ except AttributeError :
54
+ continue
55
+ assert_false (hasattr (klass , attr ),
56
+ msg = "Time to remove %s.%s.%s" % (module_name , cls , attr ))
0 commit comments