Commits

Anonymous committed e3b0dd0

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

Comments (0)

Files changed (2)

Lib/test/bootstrap/dicts.py

 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())

Lib/test/bootstrap/lists.py

 d = ("success: single item with comma",)
 print(d[0])
 
+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')