Skip to content

Commit 73366d9

Browse files
yarikopticeffigies
authored andcommitted
ENH: enable debug session for appveyor
1 parent ac8816b commit 73366d9

File tree

4 files changed

+31
-158
lines changed

4 files changed

+31
-158
lines changed

.travis.yml

Lines changed: 0 additions & 151 deletions
This file was deleted.

appveyor.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
# CI on Windows via appveyor
33

44
environment:
5-
5+
appveyor_build_worker_cloud: gce
66
matrix:
7-
- PYTHON: C:\Python27
8-
- PYTHON: C:\Python27-x64
97
- PYTHON: C:\Python34
108
- PYTHON: C:\Python34-x64
119
- PYTHON: C:\Python35
1210
- PYTHON: C:\Python35-x64
13-
- PYTHON: C:\Python36
14-
- PYTHON: C:\Python36-x64
1511

1612
install:
1713
# Prepend newly installed Python to the PATH of this build (this cannot be
@@ -31,4 +27,14 @@ test_script:
3127
# Change into an innocuous directory and find tests from installation
3228
- mkdir for_testing
3329
- cd for_testing
34-
- nosetests --with-doctest nibabel
30+
# Print Python, numpy versions
31+
- python -c "import sys, numpy; print('Python', sys.version); print('numpy', numpy.__version__)"
32+
# Show all environment variables to ease possible future debugging
33+
- set
34+
- nosetests --with-doctest -s -v nibabel
35+
36+
37+
on_failure:
38+
# enable the next to let the build VM block for up to 60min to log in via RDP and debug
39+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://rg.gosu.cc/appveyor/ci/master/scripts/enable-rdp.ps1'))
40+

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)