chore: Use pytest-xdist (#1018)
This commit is contained in:
@@ -3,6 +3,5 @@ branch = True
|
||||
source = falcon
|
||||
omit = falcon/tests*,falcon/cmd*,falcon/bench*
|
||||
|
||||
|
||||
[report]
|
||||
show_missing = True
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from wsgiref.simple_server import make_server
|
||||
@@ -15,7 +16,7 @@ from falcon.request_helpers import BoundedStream
|
||||
import falcon.testing as testing
|
||||
|
||||
_SERVER_HOST = 'localhost'
|
||||
_SERVER_PORT = 9809
|
||||
_SERVER_PORT = 9800 + os.getpid() % 100 # Facilitates parallel test execution
|
||||
_SERVER_BASE_URL = 'http://{0}:{1}/'.format(_SERVER_HOST, _SERVER_PORT)
|
||||
_SIZE_1_KB = 1024
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
coverage>=4.1
|
||||
ddt
|
||||
pytest>=3.0.1
|
||||
pytest-cov
|
||||
pytest-xdist
|
||||
pyyaml
|
||||
requests
|
||||
six
|
||||
|
||||
2
tox.ini
2
tox.ini
@@ -27,7 +27,7 @@ commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
|
||||
whitelist_externals = mkdir
|
||||
mv
|
||||
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
|
||||
coverage run -m pytest tests []
|
||||
pytest -n 4 --cov=falcon tests []
|
||||
mkdir -p .coverage_data
|
||||
mv {toxinidir}/.coverage {toxinidir}/.coverage_data/.coverage.{envname}
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ if [ "$JYTHON" = "true" ]; then
|
||||
# bug: http://bugs.jython.org/issue527524).
|
||||
$HOME/jython/bin/pip install https://github.com/kennethreitz/requests/archive/v2.11.0.zip
|
||||
$HOME/jython/bin/pip install -r tools/test-requires
|
||||
|
||||
# python-xdist is not compatible with Jython
|
||||
$HOME/jython/bin/pip uninstall -y pytest-xdist
|
||||
else
|
||||
pip install tox coveralls
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user