Skip to content

Commit 49e3272

Browse files
author
Shoshana Berleant
committed
test for misc.py
1 parent b7d2a19 commit 49e3272

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nipype/utils/tests/test_misc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
from builtins import next
77

8-
from nipype.testing import assert_equal, assert_true, assert_false
8+
from nipype.testing import (assert_equal, assert_true, assert_false,
9+
assert_raises)
910

1011
from nipype.utils.misc import (container_to_string, getsource,
1112
create_function_from_source, str2bool, flatten,
@@ -49,6 +50,9 @@ def func1(x):
4950
f_recreated = create_function_from_source(f_src)
5051
yield assert_equal, f(2.3), f_recreated(2.3)
5152

53+
def test_func_to_str_err():
54+
bad_src = "obbledygobbledygook"
55+
yield assert_raises, RuntimeError, create_function_from_source, bad_src
5256

5357
def test_str2bool():
5458
yield assert_true, str2bool("yes")

0 commit comments

Comments
 (0)