-
Notifications
You must be signed in to change notification settings - Fork 3k
/
tox.ini
59 lines (53 loc) · 1.79 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[tox]
envlist =
ruff
mypy
py{39,310,311,312,313}
fail_fast_test_main
[testenv]
package = skip
allowlist_externals =
bash
grep
poetry
timeout
ruff
mypy
sphinx-build
commands_pre =
# Ensures test dependencies are available to derivative envs
poetry install --no-interaction --no-root --with test --no-plugins
commands =
python -m unittest discover []
; Disable these tests for now, because they are breaking. When someone has time they should be converted into regular unit tests
; bash -ec "PYTHONUNBUFFERED=1 timeout 20s python3 examples/rest.py >{temp_dir}/out.txt 2>/{temp_dir}/err.txt || true"
; grep -qm 1 'my custom error message with response text, response was {"args"' {temp_dir}/out.txt
; grep -qm 1 'ZeroDivisionError: division by zero at.*Response was {"ar' {temp_dir}/out.txt
; bash -ec '! grep . {temp_dir}/err.txt' # should be empty
bash -ec 'PYTHONUNBUFFERED=1 python3 examples/debugging_advanced.py | grep done'
; Used for running integration tests on an externally built dist (CI)
[testenv:fail_fast_test_main_external_package]
package = external
package_glob = {toxinidir}{/}dist{/}*.whl
commands =
python -m unittest -f locust.test.test_main
; Used for running integration tests on a locally installed editable package on any OS
[testenv:fail_fast_test_main]
commands_pre =
poetry install --no-interaction --no-root --with test --no-plugins
python pre_build.py
pip install .
commands =
python -m unittest -f locust.test.test_main
[testenv:ruff]
commands =
ruff check .
ruff format --check
[testenv:mypy]
commands =
mypy locust/
[testenv:docs]
commands_pre =
poetry install --no-interaction --no-root --only docs --no-plugins
commands =
sphinx-build -b html docs/ docs/_build/