Skip to content

Commit ce3c399

Browse files
committed
Extend tox.ini with {posargs} in poetry-pytest invocation
This allows limiting the scope of the test run, which can save much time. Run all tests: tox Run all tests in one file in all test environments: tox -- tests/test_api.py Run one test in all test environments: tox -- tests/test_api.py::test_api Run all tests in one test environment: tox -e py39 Run all tests in one file in one test environment: tox -e py39 -- tests/test_api.py Run one test in one test environment: tox -e py39 -- tests/test_api.py::test_api
1 parent 7c087f4 commit ce3c399

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tox.ini

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Run all tests:
2+
# tox
3+
# Run all tests in one file in all test environments:
4+
# tox -- tests/test_api.py
5+
# Run one test in all test environments:
6+
# tox -- tests/test_api.py::test_api
7+
# Run all tests in one test environment:
8+
# tox -e py39
9+
# Run all tests in one file in one test environment:
10+
# tox -e py39 -- tests/test_api.py
11+
# Run one test in one test environment:
12+
# tox -e py39 -- tests/test_api.py::test_api
13+
114
[flake8]
215
exclude=connexion/__init__.py
316
rst-roles=class,mod,obj
@@ -34,7 +47,7 @@ commands=
3447
poetry lock
3548
poetry install --all-extras --with tests
3649
poetry show
37-
poetry run python -m pytest tests --cov connexion --cov-report term-missing
50+
poetry run python -m pytest tests --cov connexion --cov-report term-missing {posargs}
3851
min: mv -f pyproject.toml.bak pyproject.toml
3952

4053
[testenv:pre-commit]

0 commit comments

Comments
 (0)