Files
micropython/tests/basics/io_bytesio_ext2.py
Damien George 54e6cfc6e3 tests/basics: Skip tests of io module individually using SKIP.
Instead of using a feature check.  This is more consistent with how other
optional modules are skipped.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-15 00:23:16 +10:00

15 lines
352 B
Python

try:
import io
except ImportError:
print("SKIP")
raise SystemExit
a = io.BytesIO(b"foobar")
try:
a.seek(-10)
except Exception as e:
# CPython throws ValueError, but MicroPython has consistent stream
# interface, so BytesIO raises the same error as a real file, which
# is OSError(EINVAL).
print(type(e), e.args[0] > 0)