Testing and Development¶
Use the focused runner during development. With no group it runs three smoke checks; it does not default to the full suite:
uv run --locked python -B scripts/test.py
uv run --locked python -B scripts/test.py smoke ui
uv run --locked python -B scripts/test.py --list
uv run --locked python -B scripts/test.py ui --dry-run
| Change | Focused checks |
|---|---|
| Label, spacing, palette or generic native widget interaction | smoke ui, plus the affected feature class/module |
| Geometry, assignments, material/section editors, persistence or unit editors | model, plus engineering when definitions, conversions or solver input change |
| Structural calculations, stability, loads, supports or shared solver logic | engineering and affected model/surfaces checks; full suite for shared contracts |
| Mesh recipes, slab/plate workspaces, coupling or surface topology | surfaces; add mcp for remote editing and viewport-surfaces for rendering/selection changes |
| MCP schemas, permissions, edits or control mode | mcp with --extra mcp; add affected model/surface/engineering groups |
| Analysis workers, live recalculation, recovery or shutdown | integration and affected feature groups |
| 3D frame drawing, picking, orbit or rendering | viewport-frame; both viewer suites with viewport when shared renderer code changes |
| Documentation | docs tooling, followed by the strict docs build/link check below |
| Packaging/version metadata | release; complete the release validation checklist for distributions |
| Test runner/group definitions | tooling and --check; verify full selection and the full suite when changing shared test infrastructure |
Groups select existing modules or complete test classes; files with mixed
responsibilities can be split between groups without moving code or breaking
fixture imports. Some UI/model integration tests perform small example solves to
check displayed results or editing behaviour. The dedicated engineering and
surface benchmark suites are excluded from ui.
Combine groups or target one module, class or method; overlapping selections run each test once:
uv run --locked --extra mcp python -B scripts/test.py mcp surfaces
uv run --locked python -B scripts/test.py test_qt_materials.MaterialEditorTests
uv run --locked python -B scripts/test.py test_qt_theme.ThemeTests.test_multiple_editors_sync_theme_actions
uv run --locked python -B scripts/test.py --check
tests/groups.toml assigns every test class to exactly one primary group. New
classes or modules without ownership, unknown selectors and duplicate primary
ownership fail validation. The smoke profile selects a few methods across groups.
Listing, dry runs and coverage checks use only Python's standard library and do
not import unrelated tests, Qt, PyNite or optional SDKs. --collect-only imports
only the selected Python tests and lists their IDs without executing them.
-v prints individual results; --failfast stops after a failure. Failures and
missing viewport tools return a nonzero status. This runner installs nothing.
The viewport groups invoke the existing offline scripts, using the separately
installed Node/Playwright/Chromium tools described below and the same
PLAYWRIGHT_MODULE / PLAYWRIGHT_BROWSERS_PATH environment settings. The docs
group runs documentation unit checks; the strict site build remains a separate
command so normal tests do not require Zensical. mcp needs the optional extra to
include wire tests; otherwise those tests retain their existing skip behaviour.
Run the complete Python suite for changes to shared infrastructure/model/solver
contracts and before releases. A passing focused group is not permission to
ignore a known failure elsewhere. all includes every Python group, including
smoke cases through their primary classes, but does not start browser checks,
performance benchmarks or a documentation build automatically. An explicit all
run compares actual test IDs with ordinary unittest discovery before execution,
including inherited or dynamically supplied cases:
uv run --locked --extra mcp python -B scripts/test.py all
# Original unittest discovery remains supported:
uv run --locked --extra mcp python -B -m unittest discover -s tests
The Qt interaction tests run offscreen. The suite covers project persistence, undo/redo, result invalidation, analytical beam checks, portal-frame diagrams, inclined/reversed members, point-force/moment jumps, explicit member connections, load preservation during splitting, rejection of invalid model topology, mixed-material/section stiffness, legacy-file migration, and material/section assignment with undo.
Spatial regressions cover all six cantilever DOFs, biaxial tip moments, torsion,
roll/inertia changes, oblique local/global transformations, uniform/varying loads,
springs, missing out-of-plane restraints, self-weight, spatial combinations,
version dispatch, units, editing history, snapshots and reports. Widget tests use
PYNITEGUI_NO_WEBENGINE=1 to avoid initializing Chromium; this is a test-only switch.
Visible installed-wheel checks are separate. Install the MCP wheel into a fresh
environment outside the checkout, use its Python in an active desktop session,
and leave QT_QPA_PLATFORM and PYNITEGUI_NO_WEBENGINE unset:
cd /tmp
/tmp/pynitegui-rc-mcp/bin/python /absolute/path/to/PyniteGUI/scripts/smoke_desktop.py --output /tmp/pynitegui-desktop-qa --hold
The script rejects editable imports and offscreen mode. It uses disposable
settings/projects, QtTest clicks and application commands for generators,
arrays, undo/redo, save/reopen, background analysis, governing stations, CSV/PDF,
both official space frames, actual WebEngine rendering and MCP lock/unlock on
an ephemeral local port. It records screenshots, dependency/renderer diagnostics
and a check list in the output directory; a timeout trace helps diagnose stalls.
The --hold option leaves the verified window open for human checks. File paths
are supplied programmatically, so real OS file pickers, keyboard shortcuts and
the interactive print dialog still require human verification. It does not
certify physical printing or any platform on which it was not run. See
RELEASE.md for exact observed versions and outstanding gates.
For real viewport checks, install Playwright in a separate developer environment
with its Chromium browser, then run node tests/viewport3d.spec.cjs with Playwright
available to Node (or set PLAYWRIGHT_MODULE to its installed package directory).
The script serves local assets temporarily and closes both browser/server after
testing desktop canvas pixels, framing, six signed gizmo views, keyboard reset,
zoom/selection preservation, orbit, node picking, all three work-plane drawing
modes, six force/moment overlays with rolled members, PNG capture and dark
appearance. Screenshots go to /tmp/pynite-3d-qa
by default, configurable with VIEWPORT_QA_OUTPUT. It does not launch the user's GUI.
PLAYWRIGHT_EXECUTABLE_PATH optionally selects an installed Chromium-compatible
test browser; otherwise Playwright uses its downloaded Chromium.
Source: GUIDE.md. This manual follows the current repository; the published rc1 wheel has a smaller feature set.