MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_dontreadfrominput

Function test_dontreadfrominput

testing/test_capture.py:889–900  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

887
888
889def test_dontreadfrominput() -> None:
890 from _pytest.capture import DontReadFromInput
891
892 f = DontReadFromInput()
893 assert f.buffer is f
894 assert not f.isatty()
895 pytest.raises(OSError, f.read)
896 pytest.raises(OSError, f.readlines)
897 iter_f = iter(f)
898 pytest.raises(OSError, next, iter_f)
899 pytest.raises(UnsupportedOperation, f.fileno)
900 f.close() # just for completeness
901
902
903def test_captureresult() -> None:

Callers

nothing calls this directly

Calls 3

isattyMethod · 0.95
closeMethod · 0.95
DontReadFromInputClass · 0.90

Tested by

no test coverage detected