From 14848ffa1266bfb6f573968ed9ef6862a20bf37a Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 12 Feb 2016 23:38:30 +0000 Subject: [PATCH] tests: Reduce large object allocations so tests can run with small heap. --- tests/basics/dict1.py | 4 ++-- tests/basics/dict_copy.py | 4 ++-- tests/basics/enumerate.py | 2 +- tests/basics/list_sort.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/basics/dict1.py b/tests/basics/dict1.py index 1356cd4280..f189266b4d 100644 --- a/tests/basics/dict1.py +++ b/tests/basics/dict1.py @@ -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]) diff --git a/tests/basics/dict_copy.py b/tests/basics/dict_copy.py index c3eb7ffc18..e2fc94aeb1 100644 --- a/tests/basics/dict_copy.py +++ b/tests/basics/dict_copy.py @@ -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)) diff --git a/tests/basics/enumerate.py b/tests/basics/enumerate.py index 88747557a0..00595cb0f6 100644 --- a/tests/basics/enumerate.py +++ b/tests/basics/enumerate.py @@ -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))) diff --git a/tests/basics/list_sort.py b/tests/basics/list_sort.py index c185ddcd16..d10e2a6e4e 100644 --- a/tests/basics/list_sort.py +++ b/tests/basics/list_sort.py @@ -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)