Skip to content

gh-115142: Skip some test cases in Lib/test/test_compile if _testinternalcapi is not available #124474

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

Merged
merged 2 commits into from
Sep 30, 2024
Merged
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_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
import types
import textwrap
import warnings
import _testinternalcapi
try:
import _testinternalcapi
except ImportError:
_testinternalcapi = None

from test import support
from test.support import (script_helper, requires_debug_ranges, run_code,
Expand Down Expand Up @@ -2605,6 +2608,8 @@ def test_return_inside_async_with_block(self):
"""
self.check_stack_size(snippet, async_=True)

@support.cpython_only
@unittest.skipIf(_testinternalcapi is None, 'need _testinternalcapi module')
class TestInstructionSequence(unittest.TestCase):
def compare_instructions(self, seq, expected):
self.assertEqual([(opcode.opname[i[0]],) + i[1:] for i in seq.get_instructions()],
Expand Down
Loading