Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] converting tests from nibabel/tests/ #840

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ script:
cd for_testing
cp ../.coveragerc .
nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
pytest -v ../nibabel/tests/test_affines.py ../nibabel/tests/test_volumeutils.py
pytest -v ../nibabel/tests
else
false
fi
Expand Down
1 change: 1 addition & 0 deletions nibabel/optpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def optional_package(name, trip_msg=None, min_version=None):
% (name, name, exc))
pkg = TripWire(trip_msg)

# TODO dj: no clue why is it needed...
djarecka marked this conversation as resolved.
Show resolved Hide resolved
def setup_module():
if have_nose:
import nose
Expand Down
5 changes: 2 additions & 3 deletions nibabel/testing_pytest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
slow = dec.slow

from ..deprecated import deprecate_with_version as _deprecate_with_version

from .np_features import memmap_after_ufunc
from .helpers import bytesio_filemap, bytesio_round_trip, assert_data_similar

from itertools import zip_longest

Expand All @@ -45,8 +46,6 @@ def test_data(subdir=None, fname=None):
data_path = test_data()


from .np_features import memmap_after_ufunc

def assert_dt_equal(a, b):
""" Assert two numpy dtype specifiers are equal

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

import numpy as np

from ..openers import ImageOpener
from ..tmpdirs import InTemporaryDirectory
from ..optpkg import optional_package
_, have_scipy, _ = optional_package('scipy.io')

from nose.tools import assert_true
from numpy.testing import assert_array_equal


Expand Down Expand Up @@ -51,6 +48,6 @@ def assert_data_similar(arr, params):
return
summary = params['data_summary']
real_arr = np.asarray(arr)
assert_true(np.allclose(
assert np.allclose(
(real_arr.min(), real_arr.max(), real_arr.mean()),
(summary['min'], summary['max'], summary['mean'])))
(summary['min'], summary['max'], summary['mean']))
Loading