We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46083e3 commit ebc218aCopy full SHA for ebc218a
1 file changed
stdlib/builtin/tests/builtin.py
@@ -469,4 +469,16 @@ class C: pass
469
assert lib.libvar == 43
470
assert lib.libclass().method() == 44
471
472
+doc="input"
473
+import sys
474
+class MockStdin:
475
+ def __init__(self, line):
476
+ self._line = line
477
+ def readline(self):
478
+ return self._line
479
+old_stdin = sys.stdin
480
+sys.stdin = MockStdin("hello\n")
481
+assert input() == "hello"
482
+sys.stdin = old_stdin
483
+
484
doc="finished"
0 commit comments