Skip to content

Commit 671320a

Browse files
improved test
1 parent 6746741 commit 671320a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/python/test_objects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,12 @@ def test_constructor_stdin():
174174
assert repr(constructor).__contains__("<pythonmonkey.JSFunctionProxy object at")
175175

176176

177-
def test_stdin_tty_console_printing():
177+
def test_iterable_member_console_printing():
178178
temp_out = StringIO()
179179
sys.stdout = temp_out
180180
obj = {}
181-
obj['stdin'] = sys.stdin
181+
obj['stdin'] = sys.stdin # sys.stdin is iterable
182+
assert hasattr(sys.stdin, '__iter__') == True
182183
obj['stdin'].isTTY = sys.stdin.isatty()
183184
pm.eval('''(function iife(obj){console.log(obj['stdin'].isTTY);})''')(obj)
184185
assert temp_out.getvalue() == "\x1b[33mfalse\x1b[39m\n"

0 commit comments

Comments
 (0)