Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nibabel/nicom/tests/test_csareader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from nose.tools import (assert_true, assert_false, assert_equal, assert_raises)

from numpy.testing.decorators import skipif
from ...testing import skipif

from nibabel.pydicom_compat import dicom_test, pydicom
from .test_dicomwrappers import (IO_DATA_PATH, DATA)
Expand Down
4 changes: 3 additions & 1 deletion nibabel/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
try:
from numpy.testing import dec
skipif = dec.skipif
slow = dec.slow
except ImportError:
from numpy.testing.decorators import skipif
from numpy.testing.decorators import (skipif, slow)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something's weird with the testing because this is never getting hit, even on the numpy==1.7.1 build. See 2007.5, here:

https://codecov.io/gh/nipy/nibabel/commit/0c36551c7398dcfb132fe4ce37b115c23d183b72/build

I know it's not really relevant to this PR, but any thoughts? I checked the travis log, and see no indication that anything other than 1.7.1 was installed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No immediate idea, I am away from the laptop ATM, but if I were with it I would remove try/except and see how it fails

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's because numpy.testing.dec has existed forever. It's just an alias of an imported module, and the module it's aliasing has changed from numpy.testing.decorators to numpy.testing._private.decorators.

How about we just drop the try/except bit, and load dec, skipif, and slow?


# Allow failed import of nose if not now running tests
try:
from nose.tools import (assert_equal, assert_not_equal,
Expand Down
2 changes: 1 addition & 1 deletion nibabel/tests/nibabel_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from os import environ, listdir
from os.path import dirname, realpath, join as pjoin, isdir, exists

from numpy.testing.decorators import skipif
from ..testing import skipif


def get_nibabel_data():
Expand Down
2 changes: 1 addition & 1 deletion nibabel/tests/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from numpy.testing import (assert_almost_equal,
assert_array_equal)
from numpy.testing.decorators import skipif
from ..testing import skipif

from nose.tools import (assert_true, assert_false, assert_raises,
assert_equal, assert_not_equal)
Expand Down
9 changes: 1 addition & 8 deletions nibabel/tests/test_quaternions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@
import numpy as np
from numpy import pi

# Recent (1.2) versions of numpy have this decorator
try:
from numpy.testing.decorators import slow
except ImportError:
def slow(t):
t.slow = True
return t

from ..testing import slow
from nose.tools import assert_raises, assert_true, assert_false, \
assert_equal

Expand Down
2 changes: 1 addition & 1 deletion nibabel/tests/test_viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ..optpkg import optional_package
from ..viewers import OrthoSlicer3D

from numpy.testing.decorators import skipif
from ..testing import skipif
from numpy.testing import assert_array_equal, assert_equal

from nose.tools import assert_raises, assert_true
Expand Down