Skip to content

Commit c6353d2

Browse files
committed
TEMP: add printouts on IDs etc for one of the failures
1 parent 955f9fc commit c6353d2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

nibabel/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,10 @@ def test(*args, **kwargs):
8686

8787
def get_info():
8888
return _get_pkg_info(os.path.dirname(__file__))
89+
90+
def print_numpy_info():
91+
import numpy as np
92+
print("NUMPY: ID(numpy): %d ID(numpy.float64): %d" % (id(np), id(np.float64)))
93+
94+
def setup_package():
95+
print_numpy_info()

nibabel/tests/test_minc1.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
99
from __future__ import division, print_function, absolute_import
10+
import sys
1011

1112
from os.path import join as pjoin
1213

@@ -156,7 +157,17 @@ def test_mincfile(self):
156157
for tp in self.test_files:
157158
mnc_obj = self.opener(tp['fname'], 'r')
158159
mnc = self.file_class(mnc_obj)
159-
assert_equal(mnc.get_data_dtype().type, tp['dtype'])
160+
try:
161+
assert_equal(mnc.get_data_dtype().type, tp['dtype'])
162+
except AssertionError:
163+
from nibabel import print_numpy_info
164+
print()
165+
for l, t in (('mnc.get_data_dtype().type', mnc.get_data_dtype().type),
166+
("tp['dtype']", tp['dtype'])):
167+
print("%30s ID: %s, __module__: %s, id(sys[__module__]): %s"
168+
% (l, id(t), t.__module__, id(sys.modules[t.__module__])))
169+
print_numpy_info()
170+
raise
160171
assert_equal(mnc.get_data_shape(), tp['shape'])
161172
assert_equal(mnc.get_zooms(), tp['zooms'])
162173
assert_array_equal(mnc.get_affine(), tp['affine'])

0 commit comments

Comments
 (0)