mirror of
https://github.com/httpie/cli.git
synced 2024-11-08 00:44:45 +01:00
Parallelized tests using pytest-xdist.
This commit is contained in:
parent
3f8a000847
commit
3f63133b7c
@ -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`_.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
tox
|
||||
pytest
|
||||
pytest-xdist
|
||||
docutils
|
||||
|
5
setup.py
5
setup.py
@ -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
27
tox.ini
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user