Skip to content

Commit d80cfdb

Browse files
committed
updated tests
1 parent 7c78efd commit d80cfdb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

codeflash/verification/test_runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def run_behavioral_tests(
3636
verbose: bool = False,
3737
pytest_target_runtime_seconds: int = TOTAL_LOOPING_TIME,
3838
enable_coverage: bool = False,
39-
) -> tuple[Path, subprocess.CompletedProcess, Path | None]:
39+
) -> tuple[Path, subprocess.CompletedProcess, Path | None, Path | None]:
4040
if test_framework == "pytest":
4141
test_files: list[str] = []
4242
for file in test_paths.test_files:
@@ -73,14 +73,14 @@ def run_behavioral_tests(
7373
pytest_test_env["PYTEST_PLUGINS"] = "codeflash.verification.pytest_plugin"
7474

7575
if enable_coverage:
76-
coverage_database_file, coveragercfile = prepare_coverage_files()
76+
coverage_database_file, coverage_config_file = prepare_coverage_files()
7777

7878
cov_erase = execute_test_subprocess(
7979
shlex.split(f"{SAFE_SYS_EXECUTABLE} -m coverage erase"), cwd=cwd, env=pytest_test_env
8080
) # this cleanup is necessary to avoid coverage data from previous runs, if there are any,
8181
# then the current run will be appended to the previous data, which skews the results
8282
logger.debug(cov_erase)
83-
coverage_cmd = [SAFE_SYS_EXECUTABLE, "-m", "coverage", "run", f"--rcfile={coveragercfile.as_posix()}", "-m"]
83+
coverage_cmd = [SAFE_SYS_EXECUTABLE, "-m", "coverage", "run", f"--rcfile={coverage_config_file.as_posix()}", "-m"]
8484

8585
if pytest_cmd == "pytest":
8686
coverage_cmd.extend(["pytest"])
@@ -120,7 +120,7 @@ def run_behavioral_tests(
120120
msg = f"Unsupported test framework: {test_framework}"
121121
raise ValueError(msg)
122122

123-
return result_file_path, results, coverage_database_file if enable_coverage else None
123+
return result_file_path, results, coverage_database_file if enable_coverage else None, coverage_config_file if enable_coverage else None
124124

125125

126126
def run_benchmarking_tests(

tests/test_test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_sort(self):
4040
)
4141
fp.write(code.encode("utf-8"))
4242
fp.flush()
43-
result_file, process, coverage_pct = run_behavioral_tests(
43+
result_file, process, _, _ = run_behavioral_tests(
4444
test_files,
4545
test_framework=config.test_framework,
4646
cwd=Path(config.project_root_path),
@@ -84,7 +84,7 @@ def test_sort():
8484
)
8585
fp.write(code.encode("utf-8"))
8686
fp.flush()
87-
result_file, process, coverage_pct = run_behavioral_tests(
87+
result_file, process, _, _ = run_behavioral_tests(
8888
test_files,
8989
test_framework=config.test_framework,
9090
cwd=Path(config.project_root_path),

0 commit comments

Comments
 (0)