circuitpython/tests/basics/op_error_memoryview.py
Damien George ca9068e0ef py/objarray: Disallow memoryview addition.
Following CPython.  This is important for subsequent commits to work
correctly.

Signed-off-by: Damien George <damien@micropython.org>
2023-05-19 13:33:54 +10:00

24 lines
411 B
Python

# test errors from bad operations (unary, binary, etc)
try:
memoryview
except:
print("SKIP")
raise SystemExit
# unsupported binary operators
try:
memoryview(b"") + b""
except TypeError:
print("TypeError")
try:
memoryview(b"") + memoryview(b"")
except TypeError:
print("TypeError")
try:
m = memoryview(bytearray())
m += bytearray()
except TypeError:
print("TypeError")