Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d4c6948

Browse filesBrowse files
[3.13] gh-118846: Fix PGO tests in free-threaded build (GH-118862) (#118867)
Avoid immortalizing objects in tests that verify garbage collection of classes or modules. This fixes test_ordered_dict and test_struct. (cherry picked from commit 1b1db2f) Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent 0a23970 commit d4c6948
Copy full SHA for d4c6948

File tree

2 files changed

+4
-2
lines changed
Filter options

2 files changed

+4
-2
lines changed

‎Lib/test/test_ordered_dict.py

Copy file name to clipboardExpand all lines: Lib/test/test_ordered_dict.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import weakref
1111
from collections.abc import MutableMapping
1212
from test import mapping_tests, support
13-
from test.support import import_helper
13+
from test.support import import_helper, suppress_immortalization
1414

1515

1616
py_coll = import_helper.import_fresh_module('collections',
@@ -667,6 +667,7 @@ def test_dict_update(self):
667667
dict.update(od, [('spam', 1)])
668668
self.assertNotIn('NULL', repr(od))
669669

670+
@suppress_immortalization()
670671
def test_reference_loop(self):
671672
# Issue 25935
672673
OrderedDict = self.OrderedDict

‎Lib/test/test_struct.py

Copy file name to clipboardExpand all lines: Lib/test/test_struct.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import weakref
1010

1111
from test import support
12-
from test.support import import_helper
12+
from test.support import import_helper, suppress_immortalization
1313
from test.support.script_helper import assert_python_ok
1414

1515
ISBIGENDIAN = sys.byteorder == "big"
@@ -674,6 +674,7 @@ def __del__(self):
674674
self.assertIn(b"Exception ignored in:", stderr)
675675
self.assertIn(b"C.__del__", stderr)
676676

677+
@suppress_immortalization()
677678
def test__struct_reference_cycle_cleaned_up(self):
678679
# Regression test for python/cpython#94207.
679680

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.