mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
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.
This commit is contained in:
parent
71cc0651e7
commit
1b1db2fd9a
2 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,7 @@ import sys
|
|||
import weakref
|
||||
|
||||
from test import support
|
||||
from test.support import import_helper
|
||||
from test.support import import_helper, suppress_immortalization
|
||||
from test.support.script_helper import assert_python_ok
|
||||
|
||||
ISBIGENDIAN = sys.byteorder == "big"
|
||||
|
@ -674,6 +674,7 @@ class StructTest(unittest.TestCase):
|
|||
self.assertIn(b"Exception ignored in:", stderr)
|
||||
self.assertIn(b"C.__del__", stderr)
|
||||
|
||||
@suppress_immortalization()
|
||||
def test__struct_reference_cycle_cleaned_up(self):
|
||||
# Regression test for python/cpython#94207.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue