Skip to content

Commit 1affabe

Browse files
authored
Fix mypyc wheel tests (#18444)
#18416 removed the `mypyc/test-data` package from the wheel. This caused the wheel tests to fail. Use the `test_data_prefix` instead which uses the existing `MYPY_TEST_PREFIX` to determine the correct file location. https://github.com/mypyc/mypy_mypyc-wheels/actions/runs/12712285989
1 parent d86b1e5 commit 1affabe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mypyc/test/test_run.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from mypyc.codegen import emitmodule
2525
from mypyc.errors import Errors
2626
from mypyc.options import CompilerOptions
27+
from mypyc.test.config import test_data_prefix
2728
from mypyc.test.test_serialization import check_serialization_roundtrip
2829
from mypyc.test.testutil import (
2930
ICODE_GEN_BUILTINS,
@@ -291,9 +292,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
291292
# No driver.py provided by test case. Use the default one
292293
# (mypyc/test-data/driver/driver.py) that calls each
293294
# function named test_*.
294-
default_driver = os.path.join(
295-
os.path.dirname(__file__), "..", "test-data", "driver", "driver.py"
296-
)
295+
default_driver = os.path.join(test_data_prefix, "driver", "driver.py")
297296
shutil.copy(default_driver, driver_path)
298297
env = os.environ.copy()
299298
env["MYPYC_RUN_BENCH"] = "1" if bench else "0"

0 commit comments

Comments
 (0)