diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-12-23 22:37:02 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-12-23 22:37:02 +0000 |
| commit | 117158fcd560a84318a0b9cb5332c5599acdb84b (patch) | |
| tree | c51eb317d9572b9a49cc24eff07fa1220990618a /tests/io/file_readinto.py | |
| parent | 1c9210bc2b58303c1df2ff287f17d178b1a2772b (diff) | |
tests: Add tests for stream IO errors.
Diffstat (limited to 'tests/io/file_readinto.py')
| -rw-r--r-- | tests/io/file_readinto.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/io/file_readinto.py b/tests/io/file_readinto.py index 7a0603377..cbefc6e04 100644 --- a/tests/io/file_readinto.py +++ b/tests/io/file_readinto.py @@ -5,3 +5,10 @@ print(b) f = open("io/data/file2", "rb") print(f.readinto(b)) print(b) + +# readinto() on writable file +f = open('io/data/file1', 'ab') +try: + f.readinto(bytearray(4)) +except OSError: + print('OSError') |
