Compare commits

..

2 Commits

Author SHA1 Message Date
a45ec10b7a fix(#211): Fix two SyntaxErrors in perf_bottleneck_finder.py
Some checks failed
Test / pytest (pull_request) Failing after 23s
- Line 116: Fixed quote escaping in open() regex pattern
- Lines 509-510: Fixed split string literal in return statement
- Verified: python3 -m py_compile succeeds
2026-04-21 11:23:59 +00:00
f9f47cd12f fix(#211): Fix SyntaxError in perf_bottleneck_finder.py regex pattern
- Line 116: Fixed broken quote escaping in open() regex pattern
- Used \\" inside raw string to allow matching both quote types
- Verified: python3 -m py_compile succeeds
2026-04-21 11:17:00 +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\([^)]*[\x27\x22]w[\x27\x22]', "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):
@@ -521,7 +521,7 @@ def main():
help="Slow test threshold in seconds")
args = parser.parse_args()
# SLOW_TEST_THRESHOLD_S is module-level
global SLOW_TEST_THRESHOLD_S
SLOW_TEST_THRESHOLD_S = args.threshold
if not os.path.isdir(args.repo):