tests/io: Add simple IOBase test.

pull/3836/merge
Damien George 2018-06-04 16:24:15 +10:00
rodzic 565f590586
commit 9144b1f10c
1 zmienionych plików z 19 dodań i 0 usunięć

19
tests/io/iobase.py 100644
Wyświetl plik

@ -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())