Parallelized tests using pytest-xdist.

This commit is contained in:
Jakub Roztocil 2014-04-24 21:36:03 +02:00
parent 3f8a000847
commit 3f63133b7c
4 changed files with 33 additions and 13 deletions

View File

@ -63,15 +63,22 @@ HTTPie uses `pytest`_ and `Tox`_.
.. code-block:: bash
# Run all tests on the current Python:
### Running all tests:
# Current Python
python setup.py test
# Run all tests on all installed supported Pythons:
# All the supported and available Pythons
tox
# Run specific tests:
### Running specific tests:
# Current Python
pytest tests/test_uploads.py
# All Pythons
tox -- tests/test_uploads.py --verbose
Don't forget to add yourself to `AUTHORS.rst`_.

View File

@ -1,3 +1,4 @@
tox
pytest
pytest-xdist
docutils

View File

@ -12,7 +12,9 @@ class PyTest(TestCommand):
self.test_suite = True
self.test_args = [
'--doctest-modules',
'./httpie', './tests'
'-n', '8',
'./httpie',
'./tests'
]
self.test_suite = True
@ -23,6 +25,7 @@ class PyTest(TestCommand):
tests_require = [
'pytest',
'pytest-xdist',
]

27
tox.ini
View File

@ -1,17 +1,26 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# in multiple virtualenvs.
# Run:
# $ pip install -r requirements-dev.txt
# $ tox
[tox]
envlist = py26, py27, py34, pypy
usedevelop = True
skipsdist = True
[testenv]
commands = {envpython} setup.py test
whitelist_externals =
py.test
commands =
py.test --doctest-modules \
--basetemp={envtmpdir} \
-n 8 \
{posargs:./tests ./httpie}
[testenv:py26]
deps = argparse
[testenv:py27]
# Install docutils to test .rst files syntax
deps = docutils
deps =
argparse