---------------------------------------------------------------------- This is the API documentation for the pytest_just library. ---------------------------------------------------------------------- ## Classes Core classes JustfileFixture(root: 'Path', just_bin: 'str' = 'just') -> 'None' Helper for inspecting recipes and asserting justfile contract behaviour. ## JustfileFixture Methods Methods for the JustfileFixture class recipe_names(self, *, include_private: 'bool' = False) -> 'list[str]' List recipe names, optionally including private recipes. dependencies(self, recipe: 'str') -> 'list[str]' Return direct dependency recipe names for ``recipe``. parameters(self, recipe: 'str') -> 'list[dict[str, Any]]' Return raw parameter payloads for ``recipe``. parameter_names(self, recipe: 'str') -> 'list[str]' Return parameter names for ``recipe``. is_shebang(self, recipe: 'str') -> 'bool' Report whether ``recipe`` is marked as a shebang recipe. is_private(self, recipe: 'str') -> 'bool' Report whether ``recipe`` is marked private. doc(self, recipe: 'str') -> 'str | None' Return recipe documentation text if present. body(self, recipe: 'str') -> 'list[Any]' Return raw body fragments for ``recipe``. show(self, recipe: 'str') -> 'str' Return rendered recipe text from ``just --show`` with caching. assignments(self) -> 'dict[str, str]' Return assignment values keyed by assignment name. aliases(self) -> 'dict[str, str]' Return alias-to-target recipe mappings. assert_exists(self, recipe: 'str') -> 'None' Assert that ``recipe`` exists. assert_depends_on(self, recipe: 'str', expected: 'list[str]', transitive: 'bool' = False, exact: 'bool' = False) -> 'None' Assert dependency expectations for a recipe. assert_parameter(self, recipe: 'str', parameter: 'str', **expected: 'Any') -> 'None' Assert that ``recipe`` declares ``parameter``, optionally checking attributes. When called without keyword arguments, checks that the parameter exists. Each keyword argument is checked against the parameter's dump payload. Args: recipe: Recipe name or namepath. parameter: Name of the parameter to inspect. **expected: Attribute name/value pairs to verify (e.g. ``short="i"``, ``long="interactive"``, ``kind="singular"``). Raises: AssertionError: If the parameter does not exist or any attribute does not match. assert_body_contains(self, recipe: 'str', text: 'str') -> 'None' Assert that rendered recipe text contains ``text``. assert_not_shebang(self, recipe: 'str') -> 'None' Assert that ``recipe`` can be dry-run safely. assert_variable_referenced(self, recipe: 'str', variable: 'str') -> 'None' Assert that ``variable`` is structurally referenced in recipe body fragments. dry_run(self, recipe: 'str', *args: 'str', env: 'dict[str, str] | None' = None) -> 'subprocess.CompletedProcess[str]' Run ``just --dry-run`` for any recipe, including shebang and script recipes. ``just --dry-run`` does not run recipes of any kind — linewise, shebang, or script. See https://github.com/casey/just/issues/3177. assert_dry_run_contains(self, recipe: 'str', text: 'str', *args: 'str', env: 'dict[str, str] | None' = None) -> 'None' Assert successful dry-run output contains ``text``. ## Exceptions Exception classes JustCommandError Raised when invoking `just` fails. JustJsonFormatError Raised when `just --dump` JSON is malformed or incompatible. UnknownRecipeError Raised when a requested recipe does not exist.