From 3ca003a94d64ff1a97a3af368fff3bc18b9d8948 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Wed, 30 Dec 2020 11:53:49 -0600 Subject: [PATCH] Fix test --- extra_tests/snippets/builtin_slice.py | 3 --- extra_tests/snippets/bytearray.py | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extra_tests/snippets/builtin_slice.py b/extra_tests/snippets/builtin_slice.py index 89ef5dba94..6c2dd847b4 100644 --- a/extra_tests/snippets/builtin_slice.py +++ b/extra_tests/snippets/builtin_slice.py @@ -1,5 +1,4 @@ from testutils import assert_raises -import sys a = [] assert a[:] == [] @@ -130,5 +129,3 @@ def test_all_slices(): test_all_slices() - -assert_raises(IndexError, lambda: b[::0], _msg='bytearray index out of range') \ No newline at end of file diff --git a/extra_tests/snippets/bytearray.py b/extra_tests/snippets/bytearray.py index 0abfc01275..3550149a35 100644 --- a/extra_tests/snippets/bytearray.py +++ b/extra_tests/snippets/bytearray.py @@ -1,5 +1,6 @@ from testutils import assert_raises import pickle +import sys # new assert bytearray([1, 2, 3]) @@ -753,4 +754,8 @@ b = pickle.loads(pickle.dumps(a, 4)) assert type(a) == type(b) assert a.x == b.x assert a.y == b.y -assert a == b \ No newline at end of file +assert a == b + +a = bytearray() +for i in range(-1, 2, 1): + assert_raises(IndexError, lambda: a[-sys.maxsize - i], _msg='bytearray index out of range') \ No newline at end of file