1. John Rizzo
  2. pynie


allisonrandal  committed e3b0dd0

Adding tests for deleting items from lists and dictionaries. Modified
version of patch LP #525366. Thanks to David Glick for the tests.

  • Participants
  • Parent commits 24795c6
  • Branches default

Comments (0)

Files changed (2)

File Lib/test/bootstrap/dicts.py

View file
 if b == 'baz': print('success: add element to dict')
 else: print('failure: add element to dict')
+print('test: delete element from dict')
+del a['bar']
+if 'bar' in a: print('failure: delete element from dict')
+else: print('success: delete element from dict')
 print("test: integer as index")
 a = {1: 2}
 b = list(a.keys())

File Lib/test/bootstrap/lists.py

View file
 d = ("success: single item with comma",)
+d = ["single item"]
+print('test: delete from list')
+del d[0]
+if len(d): print('failure: delete from list')
+else: print('success: delete from list')
 print('test: delete list')
 del a
 print('success: delete list')