diff options
author | Sam Gross <colesbury@gmail.com> | 2024-10-24 18:09:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 18:09:59 -0400 |
commit | 332356b880576a1a00b5dc34f03d7d3995dd4512 (patch) | |
tree | 1f29a5ca46bb083c99e9d623f2da14a0f523014c /Lib/test/test_capi/test_misc.py | |
parent | 1306f33c84b2745aa8af5e3e8f680aa80b836c0e (diff) | |
download | cpython-332356b880576a1a00b5dc34f03d7d3995dd4512.tar.gz cpython-332356b880576a1a00b5dc34f03d7d3995dd4512.zip |
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.
Diffstat (limited to 'Lib/test/test_capi/test_misc.py')
-rw-r--r-- | Lib/test/test_capi/test_misc.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index 5c6faa1626d..80e705a37c4 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -25,7 +25,6 @@ from test.support import import_helper from test.support import threading_helper from test.support import warnings_helper from test.support import requires_limited_api -from test.support import suppress_immortalization from test.support import expected_failure_if_gil_disabled from test.support import Py_GIL_DISABLED from test.support.script_helper import assert_python_failure, assert_python_ok, run_python_until_end @@ -481,7 +480,6 @@ class CAPITest(unittest.TestCase): def test_null_type_doc(self): self.assertEqual(_testcapi.NullTpDocType.__doc__, None) - @suppress_immortalization() def test_subclass_of_heap_gc_ctype_with_tpdealloc_decrefs_once(self): class HeapGcCTypeSubclass(_testcapi.HeapGcCType): def __init__(self): @@ -499,7 +497,6 @@ class CAPITest(unittest.TestCase): del subclass_instance self.assertEqual(type_refcnt - 1, sys.getrefcount(HeapGcCTypeSubclass)) - @suppress_immortalization() def test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once(self): class A(_testcapi.HeapGcCType): def __init__(self): |