Compare commits

..

2 Commits

Author SHA1 Message Date
b46e9fef04 fix: three syntax errors in perf_bottleneck_finder.py (#211)
Some checks failed
Test / pytest (pull_request) Failing after 27s
1. Line 116: escaped double quotes in raw string regex char classes
2. Lines 509-510: merged split string into single line
3. Line 524: moved global declaration to start of main()
2026-04-21 11:44:52 +00:00
99d5832fa9 fix: regex syntax error in perf_bottleneck_finder.py (#211)
The raw string regex for detecting file I/O in tests had an unclosed
parenthesis from open(. Added the closing ) to fix SyntaxError that
blocked pytest collection.
2026-04-21 11:23:59 +00: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"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"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):
@@ -509,6 +509,7 @@ def format_markdown(report: PerfReport) -> str:
return "\n".join(lines)
# ── Main ───────────────────────────────────────────────────────────
def main():