Added more assertions to DontReadFromInput tests

This commit is contained in:
Robert O'Shea 2022-07-30 02:02:46 +01:00
parent 89e5ef5e74
commit f6a3970193
1 changed files with 9 additions and 0 deletions

View File

@ -897,6 +897,15 @@ def test_dontreadfrominput() -> None:
iter_f = iter(f)
pytest.raises(OSError, next, iter_f)
pytest.raises(UnsupportedOperation, f.fileno)
pytest.raises(UnsupportedOperation, f.flush)
assert not f.readable()
pytest.raises(UnsupportedOperation, f.seek, 0)
assert not f.seekable()
pytest.raises(UnsupportedOperation, f.tell)
pytest.raises(UnsupportedOperation, f.truncate, 0)
pytest.raises(UnsupportedOperation, f.write, b"")
pytest.raises(UnsupportedOperation, f.writelines, [])
assert not f.writable()
f.close() # just for completeness