Skip to content

Commit 14521a1

Browse files
Asserts on mortality
1 parent 36a2fb4 commit 14521a1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_stackrefs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def run_with_refcount_check(self, func, obj):
3737
immortal_objs = (None, True, False, 42, '1')
3838

3939
for obj in immortal_objs:
40+
self.assertTrue(sys._is_immortal(obj))
4041
results = set()
4142
for func in funcs_with_incref + funcs_with_borrow:
4243
refcount, flags = run_with_refcount_check(self, func, obj)
@@ -48,6 +49,7 @@ def run_with_refcount_check(self, func, obj):
4849
mortal_objs = (object(), range(10), iter([1, 2, 3]))
4950

5051
for obj in mortal_objs:
52+
self.assertFalse(sys._is_immortal(obj))
5153
results = set()
5254
for func in funcs_with_incref:
5355
refcount, flags = run_with_refcount_check(self, func, obj)

0 commit comments

Comments
 (0)