Skip to content

Commit

Permalink
Support posargs to tox (boto#1066)
Browse files Browse the repository at this point in the history
* Support posargs to tox

* Simplify arg handling in ci scripts
  • Loading branch information
kmosher authored and dstufft committed Apr 25, 2017
1 parent a094081 commit 18f2969
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ the ``pip install boto3`` defined above:
Running Tests
~~~~~~~~~~~~~
You can run tests in all supported Python versions using ``tox``. By default,
it will run all of the unit tests, but you can also specify your own
it will run all of the unit and functional tests, but you can also specify your own
``nosetests`` options. Note that this requires that you have all supported
versions of Python installed, otherwise you must pass ``-e`` or run the
``nosetests`` command directly:

.. code-block:: sh
$ tox
$ tox tests/unit/test_session.py
$ tox -e py26,py33 tests/integration
$ tox -- unit/test_session.py
$ tox -e py26,py33 -- integration/
You can also run individual tests with your default Python version:

Expand Down
13 changes: 7 additions & 6 deletions scripts/ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
# binary package not from the CWD.

import os
import sys
from subprocess import check_call

_dname = os.path.dirname

REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__))))
os.chdir(os.path.join(REPO_ROOT, 'tests'))

args = sys.argv[1:]
if not args:
args = ['unit/', 'functional/']

def run(command):
return check_call(command, shell=True)


run('nosetests --with-coverage --cover-erase --cover-package boto3 '
'--with-xunit --cover-xml -v unit/ functional/')
check_call(['nosetests', '--with-coverage', '--cover-erase',
'--cover-package', 'boto3', '--with-xunit', '--cover-xml',
'-v'] + args)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ skipsdist = True
[testenv]
commands =
{toxinidir}/scripts/ci/install
{toxinidir}/scripts/ci/run-tests
{toxinidir}/scripts/ci/run-tests {posargs}

0 comments on commit 18f2969

Please sign in to comment.