You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,27 @@
1
1
# pytest-just
2
2
A pytest plugin for testing justfiles.
3
+
## What is pytest-just?
4
+
`pytest-just` is a plugin that adds a session-scoped `just` fixture to pytest so you can test `justfile` contracts directly in your test suite.
3
5
4
-
## Status
5
-
Early-stage project scaffold based on `SPEC.md`.
6
+
It is designed for assertions about recipe structure and intent, including:
6
7
7
-
## Goals
8
-
- Test recipe existence, dependencies, parameters, and body content.
9
-
- Validate variable threading using `just --dump --dump-format json`.
10
-
- Support safe smoke checks with `just --dry-run`.
8
+
- recipe existence
9
+
- dependency relationships
10
+
- parameter contracts
11
+
- rendered body content
12
+
- alias and assignment mapping
13
+
14
+
## Why use pytest-just?
15
+
As projects grow, `justfile` automation often becomes critical but under-tested. Small recipe changes can quietly break CI, local developer workflows, or release steps.
16
+
17
+
`pytest-just` helps by making contract checks:
18
+
19
+
- fast
20
+
- repeatable
21
+
- easy to run in CI
22
+
- explicit in code review
23
+
24
+
This catches automation drift early without requiring full end-to-end execution of every command.
11
25
12
26
## Tooling
13
27
- Package and commands: `uv`
@@ -20,14 +34,13 @@ Early-stage project scaffold based on `SPEC.md`.
20
34
uv sync
21
35
uv run pytest
22
36
```
23
-
## How it works
24
-
`pytest-just`does not execute recipes directly. Instead, it asks `just` for structured metadata and rendered recipe text:
37
+
## How does pytest-just work?
38
+
`pytest-just`primarily validates recipe contracts instead of running full recipe side effects. It asks `just` for structured metadata and rendered recipe text:
25
39
26
40
-`just --dump --dump-format json` for recipe graph, parameters, attributes, aliases, and assignments
27
41
-`just --show <recipe>` for rendered body text checks
28
42
-`just --dry-run <recipe>` for safe command smoke checks
29
-
30
-
This keeps tests fast and side-effect free while still validating justfile contracts.
43
+
This keeps tests fast and mostly side-effect free while still validating real justfile behaviour.
0 commit comments