Skip to content

Commit 18edfe3

Browse files
committed
tst: ensure strings remain strings
1 parent 402e2f8 commit 18edfe3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nipype/utils/tests/test_misc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from builtins import next
88

99
import pytest
10+
import sys
1011

1112
from nipype.utils.misc import (container_to_string, getsource,
1213
create_function_from_source, str2bool, flatten,
@@ -81,3 +82,11 @@ def test_flatten():
8182

8283
back = unflatten([], [])
8384
assert back == []
85+
86+
@pytest.mark.skipif(sys.version_info[0] > 2, reason="test unicode in functions")
87+
def test_func_py2():
88+
def is_string():
89+
return isinstance('string', str)
90+
91+
wrapped_func = create_function_from_source(getsource(is_string))
92+
assert is_string() == wrapped_func()

0 commit comments

Comments
 (0)