Skip to content

Commit

Permalink
docs(dev): add some hard-won pytest tips and tricks (#10224)
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored Sep 25, 2024
1 parent a54ecea commit d8638b6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
23 changes: 23 additions & 0 deletions docs/contribute/02_workflow.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,29 @@ To run the tests for a specific backend (e.g. sqlite):
pytest -m sqlite
```

#### Running the test suite efficiently when making large changes to a backend

If you are adding a new backend, or dealing with a major refactor, some `pytest`
tricks can help speed you along through finding and fixing various test
failures.

Run the tests for your backend tests in parallel

```sh
pytest -m duckdb -n auto --dist loadgroup --snapshot-update
```

Then run only the failed tests using `stepwise` and don't randomize the test
order:

```sh
pytest -m duckdb --randomly-dont-reorganize --lf --sw
```

`pytest` will stop after a test failure, then you can fix the failing test, then
re-run the same `stepwise` command and it will pick up where it left off.


### Setting up non-trivial backends

::: {.callout-note}
Expand Down
11 changes: 6 additions & 5 deletions docs/contribute/04_maintainers_guide.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ Dependency updates are automated using [Mend Renovate](https://www.mend.io/renov

### poetry

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

```sh
poetry lock --no-update
poetry export --extras all --with dev --with test --with docs --without-hashes --no-ansi > requirements-dev.txt
just check-poetry
```

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

## Adding examples
## Adding entries to `ibis.examples`

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

Expand Down

0 comments on commit d8638b6

Please sign in to comment.