Skip to content

FIX less brittle test #1707

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

Merged
merged 1 commit into from
Nov 10, 2016
Merged
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
6 changes: 3 additions & 3 deletions nipype/algorithms/tests/test_tsnr.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:

from ...testing import (assert_equal, assert_true, assert_almost_equal,
skipif, utils)
from ...testing import (assert_equal, assert_almost_equal, assert_in, utils)
from ..confounds import TSNR
from .. import misc

Expand Down Expand Up @@ -88,11 +87,12 @@ def test_tsnr_withpoly3(self):

@mock.patch('warnings.warn')
def test_warning(self, mock_warn):
''' test that usage of misc.TSNR trips a warning to use confounds.TSNR instead '''
# run
misc.TSNR(in_file=self.in_filenames['in_file'])

# assert
mock_warn.assert_called_once_with(mock.ANY, UserWarning)
assert_in(True, [args[0].count('confounds') > 0 for _, args, _ in mock_warn.mock_calls])

def assert_expected_outputs_poly(self, tsnrresult, expected_ranges):
assert_equal(os.path.basename(tsnrresult.outputs.detrended_file),
Expand Down