diff options
Diffstat (limited to 'tests/io/file_seek.py')
-rw-r--r-- | tests/io/file_seek.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/io/file_seek.py b/tests/io/file_seek.py index d6be662cb..10fb1fd06 100644 --- a/tests/io/file_seek.py +++ b/tests/io/file_seek.py @@ -23,3 +23,12 @@ print(f.seek(6)) print(f.read(5)) print(f.tell()) f.close() + +# seek closed file +f = open('io/data/file1', 'r') +f.close() +try: + f.seek(1) +except (OSError, ValueError): + # CPy raises ValueError, uPy raises OSError + print('OSError or ValueError') |