Merge "Allow tox to support regexes for unit tests"
This commit is contained in:
commit
77201c4f33
|
@ -124,6 +124,17 @@ All Pegleg tests are nested under ``tests``.
|
||||||
Pegleg comes equipped with a number of `tox`_ targets for running unit tests,
|
Pegleg comes equipped with a number of `tox`_ targets for running unit tests,
|
||||||
as well as `pep8`_ and `Bandit`_ checks.
|
as well as `pep8`_ and `Bandit`_ checks.
|
||||||
|
|
||||||
|
Unit Tests
|
||||||
|
----------
|
||||||
|
|
||||||
|
To run all unit tests, execute::
|
||||||
|
|
||||||
|
$ tox -epy35
|
||||||
|
|
||||||
|
To run unit tests using a regex, execute::
|
||||||
|
|
||||||
|
$ tox -epy35 -- <regex>
|
||||||
|
|
||||||
.. _Airship: https://airshipit.readthedocs.io
|
.. _Airship: https://airshipit.readthedocs.io
|
||||||
.. _Deckhand: https://airship-deckhand.readthedocs.io/
|
.. _Deckhand: https://airship-deckhand.readthedocs.io/
|
||||||
.. _Airship coding conventions: https://airshipit.readthedocs.io/en/latest/conventions.html
|
.. _Airship coding conventions: https://airshipit.readthedocs.io/en/latest/conventions.html
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
posargs=$@
|
||||||
|
if [ ${#posargs} -ge 1 ]; then
|
||||||
|
pytest -k ${posargs}
|
||||||
|
else
|
||||||
|
pytest
|
||||||
|
fi
|
||||||
|
set +e
|
3
tox.ini
3
tox.ini
|
@ -18,8 +18,7 @@ whitelist_externals =
|
||||||
find
|
find
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
pytest \
|
{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'
|
||||||
{posargs}
|
|
||||||
|
|
||||||
[testenv:fmt]
|
[testenv:fmt]
|
||||||
basepython=python3
|
basepython=python3
|
||||||
|
|
Loading…
Reference in New Issue