@@ -104,30 +104,10 @@ def test_old_namespace():
104
104
# Check warnings raised
105
105
arr = np .arange (24 ).reshape ((2 , 3 , 4 ))
106
106
aff = np .diag ([2 , 3 , 4 , 1 ])
107
- with clear_and_catch_warnings () as warns :
108
- warnings .simplefilter ('always' , DeprecationWarning )
109
- # Top level import.
110
- # This import does not trigger an import of the minc.py module, because
111
- # it's the proxy object.
112
- from .. import minc
113
- assert_equal (warns , [])
114
- # If there was a previous import it will be module, otherwise it will be
115
- # a proxy
116
- previous_import = isinstance (minc , types .ModuleType )
117
- if not previous_import :
118
- assert_true (isinstance (minc , ModuleProxy ))
119
- old_minc1image = minc .Minc1Image # just to check it works
120
- # There may or may not be a warning raised on accessing the proxy,
121
- # depending on whether the minc.py module is already imported in this
122
- # test run.
123
- if not previous_import :
124
- assert_equal (warns .pop (0 ).category , DeprecationWarning )
125
107
126
108
with clear_and_catch_warnings () as warns :
127
109
from .. import Minc1Image , MincImage
128
110
assert_equal (warns , [])
129
- # The import from old module is the same as that from new
130
- assert_true (old_minc1image is Minc1Image )
131
111
# But the old named import, imported from new, is not the same
132
112
assert_false (Minc1Image is MincImage )
133
113
assert_equal (warns , [])
0 commit comments