livery.extensions.pytest._guard¶
livery.extensions.pytest._guard ¶
Refuse direct pytest runs outside the workshop's runner or configured editor.
Registered through livery-extensions-pytest's pytest11 entry point,
so every pytest this venv starts carries it. A run passes the guard
when --as-livery is on the command line (passed by the test and
examples steps and by the VS Code settings fm sync renders) or
when LIVERY_PYTEST is set in the environment (inherited by xdist
workers and nested test sessions once an outer run is admitted, and set
by isolated release verification runs). Without either, pytest
refuses before collection with the commands that wrap it; --help
still prints usage.
Functions:
| Name | Description |
|---|---|
pytest_addoption |
Add |
pytest_configure |
Refuse a bare pytest run; export the variable once admitted. |
Attributes:
| Name | Type | Description |
|---|---|---|
FLAG |
|
|
VARIABLE |
|
pytest_addoption ¶
Add --as-livery, admitting a run started by the workshop or editor.
Source code in packages/extensions/pytest/src/livery/extensions/pytest/_guard.py
pytest_configure ¶
Refuse a bare pytest run; export the variable once admitted.