()
| 939 | |
| 940 | |
| 941 | def test_dontreadfrominput() -> None: |
| 942 | from _pytest.capture import DontReadFromInput |
| 943 | |
| 944 | f = DontReadFromInput() |
| 945 | assert f.buffer is f # type: ignore[comparison-overlap] |
| 946 | assert not f.isatty() # type: ignore[unreachable] |
| 947 | with pytest.raises(OSError): |
| 948 | f.read() |
| 949 | with pytest.raises(OSError): |
| 950 | f.readlines() |
| 951 | iter_f = iter(f) |
| 952 | with pytest.raises(OSError): |
| 953 | next(iter_f) |
| 954 | with pytest.raises(UnsupportedOperation): |
| 955 | f.fileno() |
| 956 | with pytest.raises(UnsupportedOperation): |
| 957 | f.flush() |
| 958 | assert not f.readable() |
| 959 | with pytest.raises(UnsupportedOperation): |
| 960 | f.seek(0) |
| 961 | assert not f.seekable() |
| 962 | with pytest.raises(UnsupportedOperation): |
| 963 | f.tell() |
| 964 | with pytest.raises(UnsupportedOperation): |
| 965 | f.truncate(0) |
| 966 | with pytest.raises(UnsupportedOperation): |
| 967 | f.write(b"") |
| 968 | with pytest.raises(UnsupportedOperation): |
| 969 | f.writelines([]) |
| 970 | assert not f.writable() |
| 971 | assert isinstance(f.encoding, str) |
| 972 | f.close() # just for completeness |
| 973 | with f: |
| 974 | pass |
| 975 | |
| 976 | |
| 977 | def test_captureresult() -> None: |
nothing calls this directly
no test coverage detected