From 439acddc6052f112e8c2e57a6d50c7569344a6bf Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 27 Feb 2018 22:39:17 +1100 Subject: [PATCH] tests/basics/gc1: Add test which triggers GC threshold. --- tests/basics/gc1.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/basics/gc1.py b/tests/basics/gc1.py index dcbe0bfcf6..332bf9744c 100644 --- a/tests/basics/gc1.py +++ b/tests/basics/gc1.py @@ -27,3 +27,8 @@ if hasattr(gc, 'threshold'): assert(gc.threshold() == 0) assert(gc.threshold(-1) is None) assert(gc.threshold() == -1) + + # Setting a low threshold should trigger collection at the list alloc + gc.threshold(1) + [[], []] + gc.threshold(-1)