Create new expected_warnings helper and some cleanup

Add new helper function for expected warnings during test

Indentation cleanups and avoid skipping doctests if possible.
This commit is contained in:
Steven Silvester
2014-12-23 07:27:45 -06:00
parent 782ba46a4c
commit a4e4e57ba5
7 changed files with 53 additions and 13 deletions
@@ -81,7 +81,7 @@ def test_2d_cg():
assert data.shape == labels.shape
with all_warnings(): # cg mode
full_prob = random_walker(data, labels, beta=90, mode='cg',
return_full_prob=True)
return_full_prob=True)
assert (full_prob[1, 25:45, 40:60] >=
full_prob[0, 25:45, 40:60]).all()
assert data.shape == labels.shape
@@ -245,7 +245,7 @@ def test_spacing_1():
# Test with `spacing` kwarg
# First, anisotropic along Y
with all_warnings(): # using cd mode
with all_warnings(): # using cg mode
labels_aniso = random_walker(data_aniso, labels_aniso, mode='cg',
spacing=(1., 2., 1.))
assert (labels_aniso[13:17, 26:34, 13:17] == 2).all()