summaryrefslogtreecommitdiff
path: root/tests/micropython
diff options
context:
space:
mode:
Diffstat (limited to 'tests/micropython')
-rw-r--r--tests/micropython/builtin_execfile.py4
-rw-r--r--tests/micropython/import_mpy_invalid.py4
-rw-r--r--tests/micropython/import_mpy_native.py4
-rw-r--r--tests/micropython/import_mpy_native_gc.py4
4 files changed, 12 insertions, 4 deletions
diff --git a/tests/micropython/builtin_execfile.py b/tests/micropython/builtin_execfile.py
index a905521c6..75a867bb9 100644
--- a/tests/micropython/builtin_execfile.py
+++ b/tests/micropython/builtin_execfile.py
@@ -16,7 +16,9 @@ class File(io.IOBase):
self.off = 0
def ioctl(self, request, arg):
- return 0
+ if request == 4: # MP_STREAM_CLOSE
+ return 0
+ return -1
def readinto(self, buf):
buf[:] = memoryview(self.data)[self.off : self.off + len(buf)]
diff --git a/tests/micropython/import_mpy_invalid.py b/tests/micropython/import_mpy_invalid.py
index 89fdf4483..f928d45c7 100644
--- a/tests/micropython/import_mpy_invalid.py
+++ b/tests/micropython/import_mpy_invalid.py
@@ -22,7 +22,9 @@ class UserFile(io.IOBase):
return n
def ioctl(self, req, arg):
- return 0
+ if req == 4: # MP_STREAM_CLOSE
+ return 0
+ return -1
class UserFS:
diff --git a/tests/micropython/import_mpy_native.py b/tests/micropython/import_mpy_native.py
index 8f5de25a0..ac5e724e8 100644
--- a/tests/micropython/import_mpy_native.py
+++ b/tests/micropython/import_mpy_native.py
@@ -28,7 +28,9 @@ class UserFile(io.IOBase):
return n
def ioctl(self, req, arg):
- return 0
+ if req == 4: # MP_STREAM_CLOSE
+ return 0
+ return -1
class UserFS:
diff --git a/tests/micropython/import_mpy_native_gc.py b/tests/micropython/import_mpy_native_gc.py
index bdeb612b4..851eb3922 100644
--- a/tests/micropython/import_mpy_native_gc.py
+++ b/tests/micropython/import_mpy_native_gc.py
@@ -22,7 +22,9 @@ class UserFile(io.IOBase):
return n
def ioctl(self, req, arg):
- return 0
+ if req == 4: # MP_STREAM_CLOSE
+ return 0
+ return -1
class UserFS: