File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,6 +149,13 @@ def __repr__(self):
149149 "wrong number of weak references to %r!" % o )
150150 verify (o is dict [o .arg ],
151151 "wrong object returned by weak dict!" )
152+ items1 = dict .items ()
153+ items2 = dict .copy ().items ()
154+ items1 .sort ()
155+ items2 .sort ()
156+ verify (items1 == items2 ,
157+ "cloning of weak-valued dictionary did not work!" )
158+ del items1 , items2
152159dict .clear ()
153160print "weak dict test complete"
154161
@@ -165,7 +172,14 @@ def __repr__(self):
165172 "wrong number of weak references to %r!" % o )
166173 verify (o .arg is dict [o ],
167174 "wrong object returned by weak dict!" )
168- del objects ,o
175+ items1 = dict .items ()
176+ items2 = dict .copy ().items ()
177+ items1 .sort ()
178+ items2 .sort ()
179+ verify (items1 == items2 ,
180+ "cloning of weak-keyed dictionary did not work!" )
181+ del items1 , items2
182+ del objects , o
169183verify (len (dict )== 0 , "deleting the keys did not clear the dictionary" )
170184print "weak key dict test complete"
171185
You can’t perform that action at this time.
0 commit comments