|
5 | 5 | from pathlib import Path |
6 | 6 |
|
7 | 7 | from codeflash.code_utils.code_utils import get_run_tmp_file |
8 | | -from codeflash.code_utils.compat import SAFE_SYS_EXECUTABLE |
| 8 | +from codeflash.code_utils.compat import get_safe_sys_executable |
9 | 9 | from codeflash.discovery.functions_to_optimize import FunctionToOptimize |
10 | 10 | from codeflash.models.models import FunctionParent, TestFile, TestFiles, TestingMode, TestType, VerificationType |
11 | 11 | from codeflash.optimization.function_optimizer import FunctionOptimizer |
@@ -54,7 +54,7 @@ def __init__(self): |
54 | 54 | with sample_code_path.open("w") as f: |
55 | 55 | f.write(sample_code) |
56 | 56 | result = execute_test_subprocess( |
57 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
| 57 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
58 | 58 | ) |
59 | 59 | assert not result.stderr |
60 | 60 | assert result.returncode == 0 |
@@ -129,7 +129,7 @@ def __init__(self): |
129 | 129 | with sample_code_path.open("w") as f: |
130 | 130 | f.write(sample_code) |
131 | 131 | result = execute_test_subprocess( |
132 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
| 132 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
133 | 133 | ) |
134 | 134 | assert not result.stderr |
135 | 135 | assert result.returncode == 0 |
@@ -194,7 +194,7 @@ def __init__(self): |
194 | 194 | with sample_code_path.open("w") as f: |
195 | 195 | f.write(sample_code) |
196 | 196 | result = execute_test_subprocess( |
197 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
| 197 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
198 | 198 | ) |
199 | 199 | assert not result.stderr |
200 | 200 | assert result.returncode == 0 |
@@ -279,7 +279,7 @@ def __init__(self): |
279 | 279 |
|
280 | 280 | # Run pytest as a subprocess |
281 | 281 | result = execute_test_subprocess( |
282 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
| 282 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
283 | 283 | ) |
284 | 284 |
|
285 | 285 | # Check for errors |
@@ -356,7 +356,7 @@ def __init__(self): |
356 | 356 | with sample_code_path.open("w") as f: |
357 | 357 | f.write(sample_code) |
358 | 358 | result = execute_test_subprocess( |
359 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
| 359 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=os.environ.copy() |
360 | 360 | ) |
361 | 361 | assert not result.stderr |
362 | 362 | assert result.returncode == 0 |
@@ -1231,7 +1231,7 @@ def __init__(self): |
1231 | 1231 | test_env.pop("CODEFLASH_TEST_CLASS", None) |
1232 | 1232 |
|
1233 | 1233 | result = execute_test_subprocess( |
1234 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=test_env |
| 1234 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=test_env |
1235 | 1235 | ) |
1236 | 1236 | assert result.returncode == 0 |
1237 | 1237 | pattern = r"TEST_INFO_START\|\((.*?)\)\|TEST_INFO_END" |
@@ -1292,7 +1292,7 @@ def __init__(self): |
1292 | 1292 |
|
1293 | 1293 | test_env = os.environ.copy() |
1294 | 1294 | result = execute_test_subprocess( |
1295 | | - cwd=test_dir, cmd_list=[f"{SAFE_SYS_EXECUTABLE}", "-m", "pytest", test_file_name, "-s"], env=test_env |
| 1295 | + cwd=test_dir, cmd_list=[f"{get_safe_sys_executable()}", "-m", "pytest", test_file_name, "-s"], env=test_env |
1296 | 1296 | ) |
1297 | 1297 | assert result.returncode == 0 |
1298 | 1298 | pattern = r"TEST_INFO_START\|\((.*?)\)\|TEST_INFO_END" |
|
0 commit comments