Pytest Test Boundaries and Developer Environment Tooling¶
Status: Accepted (partially updated by current workspace layout in
pyproject.toml:[tool.pytest.ini_options]now configuresaddopts = "--junitxml=reports/junit.xml -ra --ignore=tests/live"andtestpaths = ["tests", "packages/plugins-sinks/tests", "packages/plugins-tui/tests"]; the historicaltests/browser/directory was retired in favor of standalone Playwright verification viascripts/verify_pyodide_tutorials.py).
Context and Decision¶
During local test execution and CI maintenance, several environment and testing boundaries caused developer friction:
Pytest Test Boundaries: Executing
pytestwithout explicit--ignoreflags collectedtests/browser/(requiring headless Playwright browser binaries) and risked discoveringtests/live/(requiring live credentials and network access).Windows Shell & Console Environment: On Windows, tools installed into user scripts directories (e.g.
%APPDATA%\Python\Python3xx\Scripts\uv.exe) were absent from default PowerShell sessions. Furthermore, default console codepages (cp1252) triggeredcharmapcodecUnicodeDecodeError/UnicodeEncodeErrorwhen tools output emojis or Unicode strings.Conventional Commit Semantics for Security Work: Issue titles prefixed with
security:failed theSemantic PR TitleCI check, as standard Conventional Commits usefix:orchore:.
We decided to:
Enforce Root Pytest Ignores: Configure
[tool.pytest.ini_options]inpyproject.tomlwithaddopts = "-ra --ignore=tests/live --ignore=tests/browser"andtestpaths = ["tests", "packages/plugins-sinks/tests"]. This ensures any barepytestoruv run pytestexecution runs only the hermetic unit test suite by default. Dedicated browser and live test jobs specify their target paths explicitly.Standardize Windows Environment Helpers: Provide
scripts/env.ps1to configure UTF-8 session encoding ($env:PYTHONUTF8 = "1"), auto-detectuv.exeacross user directories and prepend it toPATH, and activate.venv. The interactive Bash setup wizard (scripts/wizards/setup-imednet-env.sh) complements this by configuring.envand offering workspace synchronization.Standardize Security Fixes under
fix:: Document that security patches and CVE remediations must use thefix:prefix (e.g.fix(deps):orfix(security):) to comply with Conventional Commits and ensure automated patch release generation viarelease-please.Group Dependabot Updates: Configure
.github/dependabot.ymlwith group rules to consolidate automated dependency updates into atomic PRs.
Consequences¶
Bare
pytestcommands run fast and safely across all environments without accidental browser or live test execution.Windows developers and automation tools have a reliable environment activator script (
scripts/env.ps1) and setup wizard (scripts/wizards/setup-imednet-env.sh) that eliminate PATH and encoding errors.PR titles and releases adhere to consistent SemVer and Conventional Commit standards.