Skip to content

Commit 790d77c

Browse files
committed
fixes to sync with main
1 parent 4bb0aad commit 790d77c

File tree

5 files changed

+11
-281
lines changed

5 files changed

+11
-281
lines changed

codeflash/discovery/pytest_new_process_discovery.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ def pytest_collection_finish(self, session) -> None:
1616
collected_tests.extend(session.items)
1717
pytest_rootdir = session.config.rootdir
1818

19+
def pytest_collection_modifyitems(config, items):
20+
skip_benchmark = pytest.mark.skip(reason="Skipping benchmark tests")
21+
for item in items:
22+
if "benchmark" in item.fixturenames:
23+
item.add_marker(skip_benchmark)
24+
1925

2026
def parse_pytest_collection_results(pytest_tests: list[Any]) -> list[dict[str, str]]:
2127
test_results = []
@@ -34,7 +40,7 @@ def parse_pytest_collection_results(pytest_tests: list[Any]) -> list[dict[str, s
3440

3541
try:
3642
exitcode = pytest.main(
37-
[tests_root, "-pno:logging", "--collect-only", "-m", "not skip", "--benchmark-skip"], plugins=[PytestCollectionPlugin()]
43+
[tests_root, "-p no:logging", "--collect-only", "-m", "not skip", "--benchmark-skip"], plugins=[PytestCollectionPlugin()]
3844
)
3945
except Exception as e: # noqa: BLE001
4046
print(f"Failed to collect tests: {e!s}") # noqa: T201

codeflash/tracer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,18 @@ def tracer_logic(self, frame: FrameType, event: str) -> None:
247247
return
248248
if self.timeout is not None and (time.time() - self.start_time) > self.timeout:
249249
sys.setprofile(None)
250+
threading.setprofile(None)
250251
console.print(f"Codeflash: Timeout reached! Stopping tracing at {self.timeout} seconds.")
251252
return
252253
code = frame.f_code
254+
253255
file_name = Path(code.co_filename).resolve()
254256
# TODO : It currently doesn't log the last return call from the first function
255257

256258
if code.co_name in self.ignored_functions:
257259
return
260+
if not file_name.is_relative_to(self.project_root):
261+
return
258262
if not file_name.exists():
259263
return
260264
if self.functions and code.co_name not in self.functions:

codeflash/verification/test_results.py

Lines changed: 0 additions & 276 deletions
This file was deleted.

codeflash/verification/test_runner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def run_behavioral_tests(
6262
"--capture=tee-sys",
6363
f"--timeout={pytest_timeout}",
6464
"-q",
65-
"-o",
66-
"addopts=",
6765
"--codeflash_loops_scope=session",
6866
"--codeflash_min_loops=1",
6967
"--codeflash_max_loops=1",

codeflash/verification/verification_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from pydantic.dataclasses import dataclass
88

9-
from codeflash.code_utils.compat import SAFE_SYS_EXECUTABLE
10-
119

1210
def get_test_file_path(test_dir: Path, function_name: str, iteration: int = 0, test_type: str = "unit") -> Path:
1311
assert test_type in {"unit", "inspired", "replay", "perf"}

0 commit comments

Comments
 (0)