diff --git a/tests/basics/int_bytes_notimpl.py b/tests/basics/int_bytes_notimpl.py new file mode 100644 index 0000000000..b47d6ab584 --- /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 0000000000..d1bf338eb6 --- /dev/null +++ b/tests/basics/int_bytes_notimpl.py.exp @@ -0,0 +1,2 @@ + + diff --git a/tests/extmod/uctypes_ptr_le.py b/tests/extmod/uctypes_ptr_le.py index 4bff585171..d0216dfb81 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 0d02cfdc8e..6f011c3c2b 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)