Skip to content

Commit c7045b1

Browse files
yuefdevpre-commit-ci[bot]codex
authored
Document local test setup and pytest commands (#435)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: gpt-6-astra <noreply@openai.com> Signed-off-by: Yusuf Efe <120668197+yuefdev@users.noreply.github.com>
1 parent 5f991f6 commit c7045b1

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎.github/CONTRIBUTING.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Contributing
22

3+
## Running tests
4+
5+
Use [tox](https://tox.wiki/) from the repository root. It creates an isolated
6+
environment and installs the project and its test dependencies:
7+
8+
```sh
9+
python -m pip install tox
10+
tox -e py
11+
```
12+
13+
Pass pytest arguments after `--` to run a single file or tests matching a name:
14+
15+
```sh
16+
tox -e py -- tests/test_number.py
17+
tox -e py -- tests/test_number.py -k intcomma
18+
```
19+
20+
Some localisation tests are skipped when compiled `.mo` translation files are missing.
21+
Generate them with `scripts/generate-translation-binaries.sh`, which requires Bash and
22+
GNU gettext's `msgfmt`. Translation-update tests also require `xgettext` and `msgmerge`.
23+
Use `tox -e py -- -rs` to see skip reasons.
24+
25+
CI generates translation binaries and runs the
26+
[configured tox environments](../tox.ini). See the [test workflow](workflows/test.yml)
27+
for supported Python versions and platforms.
28+
329
## Linting
430

531
Linting is run on the CI using [prek](https://prek.j178.dev//), and can be run locally:

0 commit comments

Comments
 (0)