Skip to content
Snippets Groups Projects
Commit 14848ffa authored by Damien George's avatar Damien George Committed by Paul Sokolovsky
Browse files

tests: Reduce large object allocations so tests can run with small heap.

parent 52d7685d
Branches
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ print(d) ...@@ -12,7 +12,7 @@ print(d)
print(d[1]) print(d[1])
x = 1 x = 1
while x < 1000: while x < 100:
d[x] = x d[x] = x
x += 1 x += 1
print(d[500]) print(d[50])
a = {i: 2*i for i in range(1000)} a = {i: 2*i for i in range(100)}
b = a.copy() b = a.copy()
for i in range(1000): for i in range(100):
print(i, b[i]) print(i, b[i])
print(len(b)) print(len(b))
...@@ -2,7 +2,7 @@ print(list(enumerate([]))) ...@@ -2,7 +2,7 @@ print(list(enumerate([])))
print(list(enumerate([1, 2, 3]))) print(list(enumerate([1, 2, 3])))
print(list(enumerate([1, 2, 3], 5))) print(list(enumerate([1, 2, 3], 5)))
print(list(enumerate([1, 2, 3], -5))) print(list(enumerate([1, 2, 3], -5)))
print(list(enumerate(range(1000)))) print(list(enumerate(range(100))))
# specifying args with keywords # specifying args with keywords
print(list(enumerate([1, 2, 3], start=1))) print(list(enumerate([1, 2, 3], start=1)))
......
...@@ -27,7 +27,7 @@ print(l) ...@@ -27,7 +27,7 @@ print(l)
print(l == sorted(l, reverse=False)) print(l == sorted(l, reverse=False))
# test large lists (should not stack overflow) # test large lists (should not stack overflow)
l = list(range(2000)) l = list(range(200))
l.sort() l.sort()
print(l[0], l[-1]) print(l[0], l[-1])
l.sort(reverse=True) l.sort(reverse=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment