On this page
The always-on env-poisoning floor: throwaway HOME and XDG dirs, a throwaway git identity and config, transport lockdown, and credential stripping.
#python.src.stricttest.envfloor
#python.src.stricttest.envfloor
The always-on env-poisoning floor.
Installed once per process before any conftest module is imported, so it binds before a test body, a fixture, or even a module-level constant can read the real environment. os.environ is mutated directly rather than through monkeypatch because the floor is session-wide and must outlive every individual test.
Extracted verbatim-in-behavior from rlsbl's test suite, with the repo-specific constants moved into :mod:stricttest.config.
#session_env_dir
def session_env_dir() -> Path | NoneThe throwaway env directory for this process, or None if not installed.
#_preserve_toolchain_vars
def _preserve_toolchain_vars(settings: Settings, real_home: str) -> NonePin the opted-in toolchain caches BEFORE HOME is repointed.
Every one of these defaults to a location under the real HOME; a throwaway HOME would send the toolchain into a cold rebuild (Go), or hide an importable module that a spawned system-python needs (PYTHONUSERBASE). They hold packages and build artifacts, not secrets -- which is why the enum is closed and why membership is opt-in per repo.
#install
def install(settings: Settings) -> NoneInstall the env-poisoning floor for this process (idempotent).
#uninstall
def uninstall() -> NoneTear down the throwaway env directory for this process.