Skip to content

Commit 9144b1f

Browse files
committed
tests/io: Add simple IOBase test.
1 parent 565f590 commit 9144b1f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/io/iobase.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
try:
2+
import uio as io
3+
except:
4+
import io
5+
6+
try:
7+
io.IOBase
8+
except AttributeError:
9+
print('SKIP')
10+
raise SystemExit
11+
12+
13+
class MyIO(io.IOBase):
14+
def write(self, buf):
15+
# CPython and uPy pass in different types for buf (str vs bytearray)
16+
print('write', len(buf))
17+
return len(buf)
18+
19+
print('test', file=MyIO())

0 commit comments

Comments
 (0)