circuitpython/tests/basics/op_error_bytearray.py
Damien George aeea204e98 tests/basics: Split out specific bytearray tests to separate files.
So they can be automatically skipped if bytearray is not enabled.
2019-10-29 22:22:37 +11:00

20 lines
360 B
Python

# test errors from bad operations (unary, binary, etc)
# unsupported unary operators
try:
~bytearray()
except TypeError:
print('TypeError')
# unsupported binary operators
try:
bytearray() // 2
except TypeError:
print('TypeError')
# object with buffer protocol needed on rhs
try:
bytearray(1) + 1
except TypeError:
print('TypeError')