mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-125900: Clean-up logic around immortalization in free-threading (#125901)
* Remove `@suppress_immortalization` decorator * Make suppression flag per-thread instead of per-interpreter * Suppress immortalization in `eval()` to avoid refleaks in three tests (test_datetime.test_roundtrip, test_logging.test_config8_ok, and test_random.test_after_fork). * frozenset() is constant, but not a singleton. When run multiple times, the test could fail due to constant interning.
This commit is contained in:
parent
1306f33c84
commit
332356b880
23 changed files with 36 additions and 137 deletions
|
@ -13,7 +13,7 @@ import random
|
|||
import textwrap
|
||||
|
||||
from test import support
|
||||
from test.support import script_helper, ALWAYS_EQ, suppress_immortalization
|
||||
from test.support import script_helper, ALWAYS_EQ
|
||||
from test.support import gc_collect
|
||||
from test.support import import_helper
|
||||
from test.support import threading_helper
|
||||
|
@ -659,7 +659,6 @@ class ReferencesTestCase(TestBase):
|
|||
# deallocation of c2.
|
||||
del c2
|
||||
|
||||
@suppress_immortalization()
|
||||
def test_callback_in_cycle(self):
|
||||
import gc
|
||||
|
||||
|
@ -752,7 +751,6 @@ class ReferencesTestCase(TestBase):
|
|||
del c1, c2, C, D
|
||||
gc.collect()
|
||||
|
||||
@suppress_immortalization()
|
||||
def test_callback_in_cycle_resurrection(self):
|
||||
import gc
|
||||
|
||||
|
@ -888,7 +886,6 @@ class ReferencesTestCase(TestBase):
|
|||
# No exception should be raised here
|
||||
gc.collect()
|
||||
|
||||
@suppress_immortalization()
|
||||
def test_classes(self):
|
||||
# Check that classes are weakrefable.
|
||||
class A(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue