Skip to content

Commit 50ec61f

Browse files
author
Shoshana Berleant
committed
less brittle test
1 parent 5e0597b commit 50ec61f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nipype/algorithms/tests/test_tsnr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33

4-
from ...testing import (assert_equal, assert_true, assert_almost_equal,
5-
skipif, utils)
4+
from ...testing import (assert_equal, assert_almost_equal, assert_in, utils)
65
from ..confounds import TSNR
76
from .. import misc
87

@@ -88,11 +87,12 @@ def test_tsnr_withpoly3(self):
8887

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

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

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

0 commit comments

Comments
 (0)