[tests] Fix perf_bottleneck_finder.py SyntaxError blocking pytest collection #211

Closed
opened 2026-04-21 07:21:42 +00:00 by Rockachopa · 2 comments
Owner

Problem

tests/test_perf_bottleneck_finder.py cannot import scripts/perf_bottleneck_finder.py because the script has a syntax error in the regex pattern list.

Current failure:

File "scripts/perf_bottleneck_finder.py", line 116
    (r"open\([^)]*['"]w['"]", "File I/O in test — use tmp_path fixture"),
                     ^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('

Reproduction

cd /tmp/compounding-intelligence-676
python3 -m pytest tests/test_perf_bottleneck_finder.py -q
python3 -m py_compile scripts/perf_bottleneck_finder.py

Impact

  • full pytest run aborts during collection
  • the performance bottleneck finder cannot be imported or executed

Acceptance Criteria

  • scripts/perf_bottleneck_finder.py parses cleanly
  • python3 -m pytest tests/test_perf_bottleneck_finder.py -q passes
  • python3 -m py_compile scripts/perf_bottleneck_finder.py succeeds
## Problem `tests/test_perf_bottleneck_finder.py` cannot import `scripts/perf_bottleneck_finder.py` because the script has a syntax error in the regex pattern list. Current failure: ``` File "scripts/perf_bottleneck_finder.py", line 116 (r"open\([^)]*['"]w['"]", "File I/O in test — use tmp_path fixture"), ^ SyntaxError: closing parenthesis ']' does not match opening parenthesis '(' ``` ## Reproduction ```bash cd /tmp/compounding-intelligence-676 python3 -m pytest tests/test_perf_bottleneck_finder.py -q python3 -m py_compile scripts/perf_bottleneck_finder.py ``` ## Impact - full pytest run aborts during collection - the performance bottleneck finder cannot be imported or executed ## Acceptance Criteria - [ ] `scripts/perf_bottleneck_finder.py` parses cleanly - [ ] `python3 -m pytest tests/test_perf_bottleneck_finder.py -q` passes - [ ] `python3 -m py_compile scripts/perf_bottleneck_finder.py` succeeds
Author
Owner

Fixed in PR #220: #220

Fixed in PR #220: https://forge.alexanderwhitestone.com/Timmy_Foundation/compounding-intelligence/pulls/220
Timmy was assigned by Rockachopa 2026-04-21 11:35:49 +00:00
Author
Owner

PR #226 created: #226

Fixed three syntax errors (the file had more than just the reported one):

  1. Line 116: unescaped " in raw string regex char class ['"]['\"]
  2. Lines 509-510: split string return " + newline + ".join() → merged
  3. Line 524: global declaration after variable use → moved to start of main()

File now compiles cleanly with python3 -m py_compile.

PR #226 created: https://forge.alexanderwhitestone.com/Timmy_Foundation/compounding-intelligence/pulls/226 Fixed three syntax errors (the file had more than just the reported one): 1. Line 116: unescaped `"` in raw string regex char class `['"]` → `['\"]` 2. Lines 509-510: split string `return "` + newline + `".join()` → merged 3. Line 524: `global` declaration after variable use → moved to start of main() File now compiles cleanly with `python3 -m py_compile`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/compounding-intelligence#211