Просмотр исходного кода

Allow tox posargs to override the test target

The previous command hardcoded `tests/` before {posargs}, so passing a
specific test path caused pytest to collect both `tests/` and the path,
running the whole suite instead of the requested test. Using
{posargs:-n 5 tests/} keeps the default parallel full-suite behavior
when no args are given but lets `tox -- <test::path>` run a single test.
Nuwan Goonasekera 1 день назад
Родитель
Сommit
e8ddc063c5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      tox.ini

+ 1 - 1
tox.ini

@@ -10,7 +10,7 @@ envlist = {py3.13,pypy}-{aws,azure,gcp,openstack,mock},lint
 
 [testenv]
 commands = # see setup.cfg for options sent to pytest and coverage
-           coverage run --source=cloudbridge -m pytest -n 5 tests/ -v {posargs}
+           coverage run --source=cloudbridge -m pytest -v {posargs:-n 5 tests/}
 setenv =
     # Fix for moto import issue: https://github.com/travis-ci/travis-ci/issues/7940
     BOTO_CONFIG=/dev/null