Skip to content

Commit f2f139c

Browse files
yuefdevcodex
andcommitted
docs: use tox for local testing instructions
Co-Authored-By: gpt-6-astra <noreply@openai.com> Signed-off-by: Yusuf Efe <120668197+yuefdev@users.noreply.github.com>
1 parent 3c2ca4e commit f2f139c

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

‎.github/CONTRIBUTING.md‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,29 @@
22

33
## Running tests
44

5-
Use Python 3.10 or newer. From the repository root, create a virtual environment:
5+
Use [tox](https://tox.wiki/) from the repository root. It creates an isolated
6+
environment and installs the project and its test dependencies:
67

78
```sh
8-
python -m venv .venv
9+
python -m pip install tox
10+
tox -e py
911
```
1012

11-
Activate it with `source .venv/bin/activate` on Linux or macOS, or
12-
`.venv\Scripts\Activate.ps1` in Windows PowerShell. Then install the project and its
13-
test dependencies:
13+
Pass pytest arguments after `--` to run a single file or tests matching a name:
1414

1515
```sh
16-
python -m pip install -e ".[tests]"
17-
```
18-
19-
Run the full suite, a single file, or tests matching a name:
20-
21-
```sh
22-
python -m pytest
23-
python -m pytest tests/test_number.py
24-
python -m pytest tests/test_number.py -k intcomma
16+
tox -e py -- tests/test_number.py
17+
tox -e py -- tests/test_number.py -k intcomma
2518
```
2619

2720
Some localisation tests are skipped when compiled `.mo` translation files are missing.
2821
Generate them with `scripts/generate-translation-binaries.sh`, which requires Bash and
2922
GNU gettext's `msgfmt`. Translation-update tests also require `xgettext` and `msgmerge`.
30-
Use `python -m pytest -rs` to see skip reasons.
23+
Use `tox -e py -- -rs` to see skip reasons.
3124

32-
CI generates translation binaries and runs tests through [tox](../tox.ini). See the
33-
[test workflow](workflows/test.yml) for supported Python versions and platforms.
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.
3428

3529
## Linting
3630

0 commit comments

Comments
 (0)