---
name: pytest-just
description: >
  A pytest plugin for testing justfile recipes. Use when writing Python code that uses the pytest_just package.
license: MIT
compatibility: Requires Python >=3.10.
---

# pytest-just

A pytest plugin for testing justfile recipes

## Installation

```bash
pip install pytest-just
```

## API overview

### Classes

Core classes

- `JustfileFixture`: Helper for inspecting recipes and asserting justfile contract behaviour

### JustfileFixture Methods

Methods for the JustfileFixture class

- `JustfileFixture.recipe_names`
- `JustfileFixture.dependencies`
- `JustfileFixture.parameters`
- `JustfileFixture.parameter_names`
- `JustfileFixture.is_shebang`
- `JustfileFixture.is_private`
- `JustfileFixture.doc`
- `JustfileFixture.body`
- `JustfileFixture.show`
- `JustfileFixture.assignments`
- `JustfileFixture.aliases`
- `JustfileFixture.assert_exists`
- `JustfileFixture.assert_depends_on`
- `JustfileFixture.assert_parameter`
- `JustfileFixture.assert_body_contains`
- `JustfileFixture.assert_not_shebang`
- `JustfileFixture.assert_variable_referenced`
- `JustfileFixture.dry_run`
- `JustfileFixture.assert_dry_run_contains`

### 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

## Resources

- [Full documentation](https://databooth.github.io/pytest-just/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
