Testing
Running the suite
$ python -m pytest
The suite lives in tests/, one module per source module:
Test module |
Covers |
|---|---|
|
parsing, |
|
option specs and value coercion |
|
TOML/INI/env loading, discovery order, precedence |
|
spec grammar, |
|
PATH/registry/launcher/uv/pyenv providers |
|
probing, caching, spec matching |
|
the |
|
Windows/POSIX creators, pyvenv.cfg, clear/upgrade |
|
every template, quoting, placeholder leaks |
|
seeder command construction (subprocesses mocked) |
|
|
|
end-to-end creation, isolation checks |
|
exception text, leveled output |
|
utilities |
|
packaging metadata and imports |
Properties the suite guarantees
Unit tests never touch the network and never spawn pip. Seeder tests intercept
run_cmd; discovery tests use the running interpreter or fakes.Integration tests create real environments under
tmp_pathand then execute the new interpreter to verifysys.prefixisolation and pip presence. These are the slow tests; everything else is milliseconds.Platform-specific tests skip cleanly. POSIX symlink behavior is skipped on Windows and vice versa (
pytest.mark/ explicit guards), so the suite is green on every supported host.No test depends on machine state. An autouse fixture points
TN_VENV_CONFIG_FILEat an empty file and strips ambientTN_VENV_*variables, so a developer’s personal configuration can never leak into a test run.
Building this documentation
$ pip install -r docs/requirements.txt
$ sphinx-build -M html docs docs/_build # POSIX
$ docs\make.bat html # Windows
The build uses Sphinx with MyST (Markdown), sphinx-design, the Read the
Docs theme, and sphinx-copybutton. docs/conf.py reads the release from
installed package metadata and falls back to tn_venv/version.py when the
package is not installed, so the docs build from a bare checkout.
Coverage and hygiene
The suite passes with 315 tests on CPython 3.14/Windows at the time of writing. New features are expected to arrive with unit tests for logic and, where the feature crosses a process boundary, one integration test that runs the real thing.