From 25f417c08c2cdb5c4a7564d1e69766c0448d7984 Mon Sep 17 00:00:00 2001 From: "John R. Lenton" Date: Fri, 3 Jan 2014 22:53:18 +0000 Subject: Worked on list.pop: * Fixes issue #51 * Adds a specific error message for when you try to pop an empty list. * Releases some memory if the list has shurnk a lot. --- tests/basics/tests/list3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/basics/tests/list3.py (limited to 'tests') diff --git a/tests/basics/tests/list3.py b/tests/basics/tests/list3.py new file mode 100644 index 000000000..bb2ccc6d6 --- /dev/null +++ b/tests/basics/tests/list3.py @@ -0,0 +1,11 @@ +# list poppin' +a = [1, 2, 3] +print(a.pop()) +print(a.pop()) +print(a.pop()) +try: + print(a.pop()) +except IndexError: + print("IndexError raised") +else: + raise AssertionError("No IndexError raised") -- cgit v1.2.3