Commit b4dea46d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests: Fix few tests which depend on order of elements in dict.

With dict being unordered of course.
parent e2adff36
d = {1: 2, 3: 4}
print(d)
print(len(d))
d.clear()
print(d)
d[2] = 42
......
d = {1: 2, 3: 4}
els = []
for i in d:
print(i, d[i])
els.append((i, d[i]))
print(sorted(els))
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))
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))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment