First of all, -s
didn't help, the test runs forever with it.
I have a test for one function, it looks like this:
def test(monkeypatch):
...
monkeypatch.setitem(__builtins__, 'input', make_multiple_inputs(input_lines))
sys.stdout = mystdout = StringIO()
...
actual = mystdout.getvalue()
It works if the tested function contains input()
but doesn't work if it contains sys.stdin.readline()
. How do I make it work with the latter?