Skip to content

Commit d48b3fc

Browse files
committed
temp pyproject also for test discovery
1 parent c7650fc commit d48b3fc

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

codeflash/discovery/discover_unit_tests.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pydantic.dataclasses import dataclass
1818

1919
from codeflash.cli_cmds.console import console, logger, test_files_progress_bar
20-
from codeflash.code_utils.code_utils import get_run_tmp_file, module_name_from_file_path
20+
from codeflash.code_utils.code_utils import get_run_tmp_file, module_name_from_file_path, custom_addopts
2121
from codeflash.code_utils.compat import SAFE_SYS_EXECUTABLE, codeflash_cache_db
2222
from codeflash.models.models import CodePosition, FunctionCalledInTest, TestsInFile, TestType
2323

@@ -150,19 +150,20 @@ def discover_tests_pytest(
150150
project_root = cfg.project_root_path
151151

152152
tmp_pickle_path = get_run_tmp_file("collected_tests.pkl")
153-
result = subprocess.run(
154-
[
155-
SAFE_SYS_EXECUTABLE,
156-
Path(__file__).parent / "pytest_new_process_discovery.py",
157-
str(project_root),
158-
str(tests_root),
159-
str(tmp_pickle_path),
160-
],
161-
cwd=project_root,
162-
check=False,
163-
capture_output=True,
164-
text=True,
165-
)
153+
with custom_addopts():
154+
result = subprocess.run(
155+
[
156+
SAFE_SYS_EXECUTABLE,
157+
Path(__file__).parent / "pytest_new_process_discovery.py",
158+
str(project_root),
159+
str(tests_root),
160+
str(tmp_pickle_path),
161+
],
162+
cwd=project_root,
163+
check=False,
164+
capture_output=True,
165+
text=True,
166+
)
166167
try:
167168
with tmp_pickle_path.open(mode="rb") as f:
168169
exitcode, tests, pytest_rootdir = pickle.load(f)

0 commit comments

Comments
 (0)