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

This commit is contained in:
Damien George 2016-02-12 23:38:30 +00:00 committed by Paul Sokolovsky
parent 52d7685d9a
commit 14848ffa12
4 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ print(d)
print(d[1])
x = 1
while x < 1000:
while x < 100:
d[x] = x
x += 1
print(d[500])
print(d[50])

View File

@ -1,5 +1,5 @@
a = {i: 2*i for i in range(1000)}
a = {i: 2*i for i in range(100)}
b = a.copy()
for i in range(1000):
for i in range(100):
print(i, b[i])
print(len(b))

View File

@ -2,7 +2,7 @@ print(list(enumerate([])))
print(list(enumerate([1, 2, 3])))
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
print(list(enumerate([1, 2, 3], start=1)))

View File

@ -27,7 +27,7 @@ print(l)
print(l == sorted(l, reverse=False))
# test large lists (should not stack overflow)
l = list(range(2000))
l = list(range(200))
l.sort()
print(l[0], l[-1])
l.sort(reverse=True)