diff options
Diffstat (limited to 'tests/basics/bytearray_append.py')
-rw-r--r-- | tests/basics/bytearray_append.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/basics/bytearray_append.py b/tests/basics/bytearray_append.py new file mode 100644 index 0000000000..06e62c6bcb --- /dev/null +++ b/tests/basics/bytearray_append.py @@ -0,0 +1,15 @@ +# test bytearray.append method + +a = bytearray(4) +print(a) + +# append should append a single byte +a.append(2) +print(a) + +# a should not be modified if append fails +try: + a.append(None) +except TypeError: + print('TypeError') +print(a) |