summaryrefslogtreecommitdiff
path: root/tests/basics/op_error_bytearray.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/op_error_bytearray.py')
-rw-r--r--tests/basics/op_error_bytearray.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/basics/op_error_bytearray.py b/tests/basics/op_error_bytearray.py
new file mode 100644
index 000000000..9ab69371d
--- /dev/null
+++ b/tests/basics/op_error_bytearray.py
@@ -0,0 +1,19 @@
+# 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')