Skip to content

Commit a0c5238

Browse files
authored
[mypyc] Fix remaining failing test on free-threaded builds (#19646)
Just skip an in irbuild test if running on a free-threaded build, since the IR looks different if free threading is enabled. Only this one test was failing for me on Python 3.14.0rc1.
1 parent 982853d commit a0c5238

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mypyc/test-data/irbuild-classes.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ L0:
180180
o.x = r1; r2 = is_error
181181
return o
182182

183-
[case testSubclass_toplevel]
183+
[case testSubclass_withgil_toplevel]
184184
from typing import TypeVar, Generic
185185
from mypy_extensions import trait
186186
T = TypeVar('T')

mypyc/test/test_irbuild.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mypy.errors import CompileError
99
from mypy.test.config import test_temp_dir
1010
from mypy.test.data import DataDrivenTestCase
11-
from mypyc.common import TOP_LEVEL_NAME
11+
from mypyc.common import IS_FREE_THREADED, TOP_LEVEL_NAME
1212
from mypyc.ir.pprint import format_func
1313
from mypyc.test.testutil import (
1414
ICODE_GEN_BUILTINS,
@@ -71,6 +71,9 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
7171
if options is None:
7272
# Skipped test case
7373
return
74+
if "_withgil" in testcase.name and IS_FREE_THREADED:
75+
# Test case should only run on a non-free-threaded build.
76+
return
7477
with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase):
7578
expected_output = remove_comment_lines(testcase.output)
7679
expected_output = replace_word_size(expected_output)

0 commit comments

Comments
 (0)