Skip to content

Commit d8638b6

Browse files
authored
docs(dev): add some hard-won pytest tips and tricks (#10224)
1 parent a54ecea commit d8638b6

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

docs/contribute/02_workflow.qmd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@ To run the tests for a specific backend (e.g. sqlite):
4646
pytest -m sqlite
4747
```
4848

49+
#### Running the test suite efficiently when making large changes to a backend
50+
51+
If you are adding a new backend, or dealing with a major refactor, some `pytest`
52+
tricks can help speed you along through finding and fixing various test
53+
failures.
54+
55+
Run the tests for your backend tests in parallel
56+
57+
```sh
58+
pytest -m duckdb -n auto --dist loadgroup --snapshot-update
59+
```
60+
61+
Then run only the failed tests using `stepwise` and don't randomize the test
62+
order:
63+
64+
```sh
65+
pytest -m duckdb --randomly-dont-reorganize --lf --sw
66+
```
67+
68+
`pytest` will stop after a test failure, then you can fix the failing test, then
69+
re-run the same `stepwise` command and it will pick up where it left off.
70+
71+
4972
### Setting up non-trivial backends
5073

5174
::: {.callout-note}

docs/contribute/04_maintainers_guide.qmd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ Dependency updates are automated using [Mend Renovate](https://www.mend.io/renov
1111

1212
### poetry
1313

14-
Occasionally you may need to lock [`poetry`](https://python-poetry.org) dependencies. Edit `pyproject.toml` as needed, then run:
14+
Occasionally you may need to lock [`poetry`](https://python-poetry.org)
15+
dependencies. Edit `pyproject.toml` as needed, then run:
1516

1617
```sh
17-
poetry lock --no-update
18-
poetry export --extras all --with dev --with test --with docs --without-hashes --no-ansi > requirements-dev.txt
18+
just check-poetry
1919
```
2020

21-
The second step updates `requirements-dev.txt` for developers using `pip`.
21+
This will update the lockfile and also update `requirements-dev.txt` for
22+
developers using `pip`.
2223

23-
## Adding examples
24+
## Adding entries to `ibis.examples`
2425

2526
If you're not a maintainer, please open an issue asking us to add your example.
2627

0 commit comments

Comments
 (0)