1
0
mirror of https://github.com/httpie/cli.git synced 2025-06-17 00:17:45 +02:00

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 .. code-block:: bash
# Run all tests on the current Python: ### Running all tests:
# Current Python
python setup.py test python setup.py test
# Run all tests on all installed supported Pythons: # All the supported and available Pythons
tox tox
# Run specific tests: ### Running specific tests:
# Current Python
pytest tests/test_uploads.py pytest tests/test_uploads.py
# All Pythons
tox -- tests/test_uploads.py --verbose
Don't forget to add yourself to `AUTHORS.rst`_. Don't forget to add yourself to `AUTHORS.rst`_.

View File

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

View File

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

27
tox.ini
View File

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