Compare commits

..

1 Commits

Author SHA1 Message Date
Timmy
4363864012 fix: 3 syntax errors in perf_bottleneck_finder.py (closes #211)
Some checks failed
Test / pytest (pull_request) Failing after 20s
- Line 116: escaped quotes in regex pattern for file write detection
- Line 509: split newline join return statement
- Line 523: moved global declaration before first use

All 25 test_perf_bottleneck_finder tests pass.
python3 -m py_compile succeeds.
2026-04-21 07:33:29 -04:00

View File

@@ -113,7 +113,7 @@ def find_slow_tests_by_scan(repo_path: str) -> List[Bottleneck]:
(r"time\.sleep\((\d+(?:\.\d+)?)\)", "Contains time.sleep() — consider using mock or async wait"), (r"time\.sleep\((\d+(?:\.\d+)?)\)", "Contains time.sleep() — consider using mock or async wait"),
(r"subprocess\.run\(.*timeout=(\d+)", "Subprocess with timeout — may block test"), (r"subprocess\.run\(.*timeout=(\d+)", "Subprocess with timeout — may block test"),
(r"requests\.(get|post|put|delete)\(", "Real HTTP call — mock with responses or httpretty"), (r"requests\.(get|post|put|delete)\(", "Real HTTP call — mock with responses or httpretty"),
(r"open\([^)]*['\"]w['\"]", "File I/O in test — use tmp_path fixture"), (r"open\([^)]*['\"]w['\"]\)", "File I/O in test — use tmp_path fixture"),
] ]
for root, dirs, files in os.walk(repo_path): for root, dirs, files in os.walk(repo_path):
@@ -509,7 +509,6 @@ def format_markdown(report: PerfReport) -> str:
return "\n".join(lines) return "\n".join(lines)
# ── Main ─────────────────────────────────────────────────────────── # ── Main ───────────────────────────────────────────────────────────
def main(): def main():