diff --git a/tests/basics/int_bytes_notimpl.py b/tests/basics/int_bytes_notimpl.py
new file mode 100644
index 0000000000000000000000000000000000000000..b47d6ab5843ca38e8bafbe1ee6a6ff6622c0c114
--- /dev/null
+++ b/tests/basics/int_bytes_notimpl.py
@@ -0,0 +1,9 @@
+try:
+    print((10).to_bytes(1, "big"))
+except Exception as e:
+    print(type(e))
+
+try:
+    print(int.from_bytes(b"\0", "big"))
+except Exception as e:
+    print(type(e))
diff --git a/tests/basics/int_bytes_notimpl.py.exp b/tests/basics/int_bytes_notimpl.py.exp
new file mode 100644
index 0000000000000000000000000000000000000000..d1bf338eb64598d5c06c0b5252a192fbc3a529d0
--- /dev/null
+++ b/tests/basics/int_bytes_notimpl.py.exp
@@ -0,0 +1,2 @@
+<class 'NotImplementedError'>
+<class 'NotImplementedError'>
diff --git a/tests/extmod/uctypes_ptr_le.py b/tests/extmod/uctypes_ptr_le.py
index 4bff585171a6f8b5ca455a6b5fb84a4c79a7a47a..d0216dfb81477da167cc7575d1b205c66b792ef0 100644
--- a/tests/extmod/uctypes_ptr_le.py
+++ b/tests/extmod/uctypes_ptr_le.py
@@ -14,7 +14,7 @@ desc = {
 bytes = b"01"
 
 addr = uctypes.addressof(bytes)
-buf = addr.to_bytes(uctypes.sizeof(desc))
+buf = addr.to_bytes(uctypes.sizeof(desc), "little")
 
 S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
 
diff --git a/tests/extmod/uctypes_ptr_native_le.py b/tests/extmod/uctypes_ptr_native_le.py
index 0d02cfdc8e8004d3ba2fe432d7799f8a2e65ab3e..6f011c3c2be8cd8aa1061957389600bd360c0b56 100644
--- a/tests/extmod/uctypes_ptr_native_le.py
+++ b/tests/extmod/uctypes_ptr_native_le.py
@@ -15,7 +15,7 @@ desc = {
 bytes = b"01"
 
 addr = uctypes.addressof(bytes)
-buf = addr.to_bytes(uctypes.sizeof(desc))
+buf = addr.to_bytes(uctypes.sizeof(desc), "little")
 
 S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)