The PyTest documentation states that stdin is redirected to null as no-one will want to do interactive testing in a batch test context. This is true, but interactive is not the
You can mock it:
def test_method(monkeypatch): monkeypatch.setattr('sys.stdin', io.StringIO('my input')) # test code