fix: Resolve syntax errors blocking pytest collection (#211, #212) #220

Open
Rockachopa wants to merge 2 commits from burn/211-1776305100 into main
Owner

Fixes #211 and #212 — Syntax errors blocking pytest collection

Three syntax errors across two files were preventing the test suite from importing these modules.

scripts/perf_bottleneck_finder.py

Line 116 — Regex pattern with unescaped mixed quotes:

# Before (SyntaxError):
(r"open\([^)]*['"]w['"]", "File I/O in test — use tmp_path fixture"),
# After:
(r'open\([^)]*["' + "'" + r'"]w["' + "'" + r'"]', "File I/O in test — use tmp_path fixture"),

Lines 509-510 — Multiline string join broken across two lines:

# Before (SyntaxError):
    return "
".join(lines)
# After:
    return "
".join(lines)

Line 523global declaration after first use of the variable:

# Before: global declared after parser uses SLOW_TEST_THRESHOLD_S as default
# After: moved global declaration to top of main(), before argparse

scripts/dependency_graph.py

Lines 152-153 — Unescaped " inside "-delimited Python strings in DOT renderer:

# Before (SyntaxError):
lines.append("  node [shape=box, style=filled, fillcolor="#1a1a2e", fontcolor="#e6edf3"];")
# After (single-quoted Python string):
lines.append('  node [shape=box, style=filled, fillcolor="#1a1a2e", fontcolor="#e6edf3"];')

Test Results

  • scripts/perf_bottleneck_finder.py: compiles clean
  • scripts/dependency_graph.py: compiles clean
  • tests/test_perf_bottleneck_finder.py: 25/25 pass
  • All scripts/*.py: compile clean

Fixes #211
Fixes #212

## Fixes #211 and #212 — Syntax errors blocking pytest collection Three syntax errors across two files were preventing the test suite from importing these modules. ### scripts/perf_bottleneck_finder.py **Line 116** — Regex pattern with unescaped mixed quotes: ```python # Before (SyntaxError): (r"open\([^)]*['"]w['"]", "File I/O in test — use tmp_path fixture"), # After: (r'open\([^)]*["' + "'" + r'"]w["' + "'" + r'"]', "File I/O in test — use tmp_path fixture"), ``` **Lines 509-510** — Multiline string join broken across two lines: ```python # Before (SyntaxError): return " ".join(lines) # After: return " ".join(lines) ``` **Line 523** — `global` declaration after first use of the variable: ```python # Before: global declared after parser uses SLOW_TEST_THRESHOLD_S as default # After: moved global declaration to top of main(), before argparse ``` ### scripts/dependency_graph.py **Lines 152-153** — Unescaped `"` inside `"`-delimited Python strings in DOT renderer: ```python # Before (SyntaxError): lines.append(" node [shape=box, style=filled, fillcolor="#1a1a2e", fontcolor="#e6edf3"];") # After (single-quoted Python string): lines.append(' node [shape=box, style=filled, fillcolor="#1a1a2e", fontcolor="#e6edf3"];') ``` ### Test Results - `scripts/perf_bottleneck_finder.py`: compiles clean - `scripts/dependency_graph.py`: compiles clean - `tests/test_perf_bottleneck_finder.py`: 25/25 pass - All `scripts/*.py`: compile clean Fixes #211 Fixes #212
Rockachopa added 2 commits 2026-04-21 11:29:29 +00:00
Owner

🚫 Cannot merge PR #220 - Merge failed. Reason:

🚫 Cannot merge PR #220 - **Merge failed**. Reason:
Author
Owner

🔎 Merge sweep 2026-04-21: not merging this PR in the current sweep. Blocked by merge conflicts / non-mergeable branch state against main. Rebase/refresh onto the base branch and rerun checks.

🔎 Merge sweep 2026-04-21: not merging this PR in the current sweep. Blocked by merge conflicts / non-mergeable branch state against `main`. Rebase/refresh onto the base branch and rerun checks.
Rockachopa reviewed 2026-04-22 13:53:01 +00:00
Rockachopa left a comment
Author
Owner

Changes suggested — 2 file(s), +5/-6 lines.

Duplicate PR: Duplicate — multiple PRs fix same syntax error (#211). Keep only the most complete.

**Changes suggested** — 2 file(s), +5/-6 lines. **Duplicate PR:** Duplicate — multiple PRs fix same syntax error (#211). Keep only the most complete.
Rockachopa reviewed 2026-04-22 13:55:51 +00:00
Rockachopa left a comment
Author
Owner

DUPLICATE — fixes the same 3 syntax errors as PRs #226, #225, #224, #219, #218, #215 (issue #211). Also fixes dependency_graph.py quote escaping (#212).

The regex fix here uses string concatenation to build the pattern, which is unnecessarily complex. PR #226 has a cleaner approach.

Recommendation: Close in favor of #226.

**DUPLICATE** — fixes the same 3 syntax errors as PRs #226, #225, #224, #219, #218, #215 (issue #211). Also fixes dependency_graph.py quote escaping (#212). The regex fix here uses string concatenation to build the pattern, which is unnecessarily complex. PR #226 has a cleaner approach. **Recommendation:** Close in favor of #226.
Rockachopa reviewed 2026-04-22 14:14:20 +00:00
Rockachopa left a comment
Author
Owner

Verdict: REQUEST_CHANGES -- DUPLICATE. One of 7 PRs fixing perf_bottleneck_finder.py SyntaxError (issue #211). Also fixes dependency_graph.py. The regex fix here uses string concatenation to build the pattern which is awkward and hard to read. Recommend closing in favor of #226 which has the cleanest approach.

Verdict: REQUEST_CHANGES -- DUPLICATE. One of 7 PRs fixing perf_bottleneck_finder.py SyntaxError (issue #211). Also fixes dependency_graph.py. The regex fix here uses string concatenation to build the pattern which is awkward and hard to read. Recommend closing in favor of #226 which has the cleanest approach.
claude reviewed 2026-04-22 16:14:21 +00:00
claude left a comment
Member

Fixes the same syntax errors as #226. The regex fix uses string concatenation which is harder to read than #226's escaped quote approach. Recommend #226 instead.

Fixes the same syntax errors as #226. The regex fix uses string concatenation which is harder to read than #226's escaped quote approach. Recommend #226 instead.
Some checks failed
Test / pytest (pull_request) Failing after 29s
This pull request has changes conflicting with the target branch.
  • scripts/perf_bottleneck_finder.py
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin burn/211-1776305100:burn/211-1776305100
git checkout burn/211-1776305100
Sign in to join this conversation.