diff options
author | Damien George <damien.p.george@gmail.com> | 2018-06-20 17:11:58 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-06-27 16:55:05 +1000 |
commit | 726804ea405483872ebc93772aea0ab0bfce0bcf (patch) | |
tree | f3ee9544b5ea83dfa671e40a4341bf91524e785c /tests/basics/io_iobase.py | |
parent | bc6c56d75d1b954b42b01dc8e10e283523b2e902 (diff) | |
download | micropython-726804ea405483872ebc93772aea0ab0bfce0bcf.tar.gz micropython-726804ea405483872ebc93772aea0ab0bfce0bcf.zip |
tests: Move non-filesystem io tests to basics dir with io_ prefix.
Diffstat (limited to 'tests/basics/io_iobase.py')
-rw-r--r-- | tests/basics/io_iobase.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/basics/io_iobase.py b/tests/basics/io_iobase.py new file mode 100644 index 0000000000..6f554b00f0 --- /dev/null +++ b/tests/basics/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()) |