Allow tox to support regexes for unit tests
This patch set adds a shell wrapper script to allow tox to be used to run a subset of unit tests via regexes: To run all unit tests, execute:: $ tox -epy35 To run unit tests using a regex, execute:: $ tox -epy35 -- <regex> Change-Id: I2ba1e18226d686cb549a075e020ba02e24204829
This commit is contained in:
parent
c20d714c61
commit
ec34ed056f
@ -124,6 +124,17 @@ All Pegleg tests are nested under ``tests``.
|
||||
Pegleg comes equipped with a number of `tox`_ targets for running unit tests,
|
||||
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
|
||||
.. _Deckhand: https://airship-deckhand.readthedocs.io/
|
||||
.. _Airship coding conventions: https://airshipit.readthedocs.io/en/latest/conventions.html
|
||||
|
10
tools/gate/run-unit-tests.sh
Executable file
10
tools/gate/run-unit-tests.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
posargs=$@
|
||||
if [ ${#posargs} -ge 1 ]; then
|
||||
pytest -k ${posargs}
|
||||
else
|
||||
pytest
|
||||
fi
|
||||
set +e
|
Loading…
x
Reference in New Issue
Block a user