Skip to content

gh-130851: Skip test_unusual_constants under refleak checker #130899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/test/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
check_impl_detail, requires_debug_ranges,
gc_collect, Py_GIL_DISABLED)
from test.support.script_helper import assert_python_ok
from test.support import threading_helper, import_helper
from test.support import threading_helper, import_helper, refleak_helper
from test.support.bytecode_helper import instructions_with_positions
from opcode import opmap, opname
from _testcapi import code_offset_to_line
Expand Down Expand Up @@ -667,6 +667,11 @@ def func2():

@cpython_only
def test_unusual_constants(self):
# We cannot use the @skipIf here because hunting_for_refleaks()
# is only true once we start executing the test.
if Py_GIL_DISABLED and refleak_helper.hunting_for_refleaks():
raise unittest.SkipTest("Immortalized objects trigger refleak detection")

# gh-130851: Code objects constructed with constants that are not
# types generated by the bytecode compiler should not crash the
# interpreter.
Expand Down
Loading