tests: Fix few tests which depend on order of elements in dict.
With dict being unordered of course.
This commit is contained in:
parent
e2adff3608
commit
b4dea46d8b
|
@ -1,5 +1,5 @@
|
|||
d = {1: 2, 3: 4}
|
||||
print(d)
|
||||
print(len(d))
|
||||
d.clear()
|
||||
print(d)
|
||||
d[2] = 42
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
d = {1: 2, 3: 4}
|
||||
els = []
|
||||
for i in d:
|
||||
print(i, d[i])
|
||||
els.append((i, d[i]))
|
||||
print(sorted(els))
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
d={1:2,3:4}
|
||||
print(d.popitem())
|
||||
print(d)
|
||||
print(d.popitem())
|
||||
print(d)
|
||||
els = []
|
||||
d = {1:2,3:4}
|
||||
a = d.popitem()
|
||||
print(len(d))
|
||||
els.append(a)
|
||||
a = d.popitem()
|
||||
print(len(d))
|
||||
els.append(a)
|
||||
try:
|
||||
print(d.popitem(), "!!!",)
|
||||
except KeyError:
|
||||
print("Raised KeyError")
|
||||
else:
|
||||
print("Did not raise KeyError")
|
||||
print(sorted(els))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
d = {1:2, 3:4}
|
||||
print(d)
|
||||
print(len(d))
|
||||
d.update(["ab"])
|
||||
print(d[1])
|
||||
print(d[3])
|
||||
|
|
|
@ -3,6 +3,6 @@ print(list(i))
|
|||
i = iter(iter([1, 2, 3]))
|
||||
print(list(i))
|
||||
i = iter(iter({1:2, 3:4, 5:6}))
|
||||
print(list(i))
|
||||
print(sorted(i))
|
||||
i = iter(iter({1, 2, 3}))
|
||||
print(list(i))
|
||||
|
|
Loading…
Reference in New Issue