diff options
-rw-r--r-- | tests/io/iobase.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/io/iobase.py b/tests/io/iobase.py new file mode 100644 index 000000000..6f554b00f --- /dev/null +++ b/tests/io/iobase.py @@ -0,0 +1,19 @@ +try: + import uio as io +except: + import io + +try: + io.IOBase +except AttributeError: + print('SKIP') + raise SystemExit + + +class MyIO(io.IOBase): + def write(self, buf): + # CPython and uPy pass in different types for buf (str vs bytearray) + print('write', len(buf)) + return len(buf) + +print('test', file=MyIO()) |