summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ordered_dict.py
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-05-09 20:06:20 (GMT)
committerGitHub <noreply@github.com>2024-05-09 20:06:20 (GMT)
commit1b1db2fd9a531e26b79b34667bccfb938c4d184d (patch)
treed01de88ac90ec05ed5c86fa17f5fc07ce86f0e0a /Lib/test/test_ordered_dict.py
parent71cc0651e79041abd648595f3030dfa41009137a (diff)
downloadcpython-1b1db2fd9a531e26b79b34667bccfb938c4d184d.zip
cpython-1b1db2fd9a531e26b79b34667bccfb938c4d184d.tar.gz
cpython-1b1db2fd9a531e26b79b34667bccfb938c4d184d.tar.bz2
gh-118846: Fix PGO tests in free-threaded build (#118862)
Avoid immortalizing objects in tests that verify garbage collection of classes or modules. This fixes test_ordered_dict and test_struct.
Diffstat (limited to 'Lib/test/test_ordered_dict.py')
-rw-r--r--Lib/test/test_ordered_dict.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py
index 4571b23..06a0e81 100644
--- a/Lib/test/test_ordered_dict.py
+++ b/Lib/test/test_ordered_dict.py
@@ -10,7 +10,7 @@ import unittest
import weakref
from collections.abc import MutableMapping
from test import mapping_tests, support
-from test.support import import_helper
+from test.support import import_helper, suppress_immortalization
py_coll = import_helper.import_fresh_module('collections',
@@ -667,6 +667,7 @@ class OrderedDictTests:
dict.update(od, [('spam', 1)])
self.assertNotIn('NULL', repr(od))
+ @suppress_immortalization()
def test_reference_loop(self):
# Issue 25935
OrderedDict = self.OrderedDict