Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/docs/5-project
Repository files (latest commit first)
Filename Latest commit message Latest commit date
maia 132d876668 vm-tests: the typecheck fails a step that rebinds a function of its script
A VM test script and `lib/k3s.py` share one namespace, so a step that assigns
`pod = ...` replaces the library's `pod()` for every later call and the test dies
mid-run with `TypeError: 'dict' object is not callable`. `ty` and
`ruff --select F` accept a module-level rebinding, so this cost a full VM round
on #6947.

`vm-test-shadow-scan.py` parses the script and fails when a name bound at module
level (assignment, `for` or `with` target, `import ... as`, walrus, `except ... as`)
is also a module-level `def`. It looks into `with`, `if`, `for`, `while` and `try`
bodies, where `with subtest(...)` steps live, and not into function or
comprehension bodies. Every `vm-test-typecheck-<name>` runs it on the script alone.
`vm-test-typecheck-shadow-control` passes only when it rejects each form of
rebinding and accepts the same names where they are local.

The one existing case, `sources` in `k8s-services`, is renamed `cred_sources`.

Closes #6951
2026-11-28 09:59:25 +01:00
..
process vm-tests: the typecheck fails a step that rebinds a function of its script 2026-11-28 09:59:25 +01:00
web-ui swarm-ui: the three toasts that didn't match read like the rest 2026-11-28 09:48:07 +01:00