mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +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
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from pickle import dump
|
||||
import sys
|
||||
from test.support import captured_stdout, requires_resource, requires_gil_enabled
|
||||
from test.support import captured_stdout, requires_resource
|
||||
from test.support.os_helper import (TESTFN, rmtree, unlink)
|
||||
from test.support.script_helper import assert_python_ok, assert_python_failure
|
||||
import textwrap
|
||||
|
@ -301,7 +301,6 @@ class TestFuncs(unittest.TestCase):
|
|||
|
||||
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
|
||||
'pre-existing trace function throws off measurements')
|
||||
@requires_gil_enabled("gh-117783: immortalization of types affects traced method names")
|
||||
def test_inst_method_calling(self):
|
||||
obj = TracedClass(20)
|
||||
self.tracer.runfunc(obj.inst_method_calling, 1)
|
||||
|
@ -335,7 +334,6 @@ class TestCallers(unittest.TestCase):
|
|||
|
||||
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
|
||||
'pre-existing trace function throws off measurements')
|
||||
@requires_gil_enabled("gh-117783: immortalization of types affects traced method names")
|
||||
def test_loop_caller_importing(self):
|
||||
self.tracer.runfunc(traced_func_importing_caller, 1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue