• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 30794326607
86%

Build:
DEFAULT BRANCH: main
Ran 03 Aug 2026 07:58AM UTC
Jobs 1
Files 137
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Aug 2026 07:37AM UTC coverage: 86.051% (+0.004%) from 86.047%
30794326607

push

github

web-flow
Match CPython's wording for unresolvable nonlocal declarations (#388)

* Match CPython's wording for unresolvable nonlocal declarations (#187)

visitNonLocalStmt fell back to the generic NameNotFoundError when a
nonlocal name has no binding in any enclosing function scope. CPython
raises a specific SyntaxError for this exact diagnostic:

    SyntaxError: no binding for nonlocal 'x' found

The generic fallback also produced a misleading "Perhaps you meant to
type 'x'?" suggestion in cases where a same-named binding exists in
scope but is unreachable (e.g. an intermediate function declares the
same name global, correctly blocking nonlocal from skipping past it) —
the Levenshtein-closest match is the identifier itself, since a name
reaching this point is by definition already spelled correctly.

Reuse ScopeConflictError (already used for the sibling #178-#181
nonlocal/global scope-conflict diagnostics, and whose reported error
name is literally "SyntaxError", matching CPython's own exception
class here) instead of introducing a new error class, and never call
suggestName for this case — there is nothing sensible to suggest.

Updated wasm-functions.spec.ts's "cannot declare parameter as
nonlocal" test: it was incidentally also asserting a NameNotFoundError
was present, since the same name failed both the #179 parameter/
nonlocal conflict and (as an unrelated side effect) the "no binding"
check; now asserts the more accurate ScopeConflictError.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017w4FqCep4j8XyFpF4kpVue

* Resolve nonlocal-error tests once instead of twice per assertion

Both tightened tests were calling toPythonAstAndResolve(code, 3) a
second time just to check for the absence of the "Perhaps you meant"
suggestion, re-parsing and re-resolving the same source for no
reason. Capture the thrown error once and assert both regexes
against its message instead.

Co-Authored-By: Claude Sonnet 5 ... (continued)

4656 of 5833 branches covered (79.82%)

Branch coverage included in aggregate %.

10378 of 11638 relevant lines covered (89.17%)

167113.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30794326607.1 03 Aug 2026 07:58AM UTC 137
86.05
GitHub Action Run
Source Files on build 30794326607
  • Tree
  • List 137
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30794326607
  • 04e1841f on github
  • Prev Build on main (#30791743260)
  • Next Build on main (#30883195291)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc