Skip to content

Commit 14848ff

Browse files
dpgeorgepfalcon
authored andcommitted
tests: Reduce large object allocations so tests can run with small heap.
1 parent 52d7685 commit 14848ff

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/basics/dict1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
print(d[1])
1313

1414
x = 1
15-
while x < 1000:
15+
while x < 100:
1616
d[x] = x
1717
x += 1
18-
print(d[500])
18+
print(d[50])

tests/basics/dict_copy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a = {i: 2*i for i in range(1000)}
1+
a = {i: 2*i for i in range(100)}
22
b = a.copy()
3-
for i in range(1000):
3+
for i in range(100):
44
print(i, b[i])
55
print(len(b))

tests/basics/enumerate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
print(list(enumerate([1, 2, 3])))
33
print(list(enumerate([1, 2, 3], 5)))
44
print(list(enumerate([1, 2, 3], -5)))
5-
print(list(enumerate(range(1000))))
5+
print(list(enumerate(range(100))))
66

77
# specifying args with keywords
88
print(list(enumerate([1, 2, 3], start=1)))

tests/basics/list_sort.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
print(l == sorted(l, reverse=False))
2828

2929
# test large lists (should not stack overflow)
30-
l = list(range(2000))
30+
l = list(range(200))
3131
l.sort()
3232
print(l[0], l[-1])
3333
l.sort(reverse=True)

0 commit comments

Comments
 (0)