From 1affabe0aafabb27ea909d1daf0f3d05c0acd3ae Mon Sep 17 00:00:00 2001
From: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date: Sat, 11 Jan 2025 19:53:16 +0100
Subject: [PATCH] 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
---
 mypyc/test/test_run.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mypyc/test/test_run.py b/mypyc/test/test_run.py
index 71367b25880b1..03d9f04861071 100644
--- a/mypyc/test/test_run.py
+++ b/mypyc/test/test_run.py
@@ -24,6 +24,7 @@
 from mypyc.codegen import emitmodule
 from mypyc.errors import Errors
 from mypyc.options import CompilerOptions
+from mypyc.test.config import test_data_prefix
 from mypyc.test.test_serialization import check_serialization_roundtrip
 from mypyc.test.testutil import (
     ICODE_GEN_BUILTINS,
@@ -291,9 +292,7 @@ def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) ->
             # No driver.py provided by test case. Use the default one
             # (mypyc/test-data/driver/driver.py) that calls each
             # function named test_*.
-            default_driver = os.path.join(
-                os.path.dirname(__file__), "..", "test-data", "driver", "driver.py"
-            )
+            default_driver = os.path.join(test_data_prefix, "driver", "driver.py")
             shutil.copy(default_driver, driver_path)
         env = os.environ.copy()
         env["MYPYC_RUN_BENCH"] = "1" if bench else "0"