mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 02:49:12 +08:00
Use tox in .travis.yml.
This way we can avoid code duplication. Also, this change makes tests faster due to ignoring the sdist step and adds Python 3.2, 3.4 and PyPy 3 to build matrix.
This commit is contained in:
parent
b1b26c5f93
commit
e84068b518
22
.travis.yml
22
.travis.yml
@ -1,13 +1,11 @@
|
|||||||
language: python
|
language: python
|
||||||
python:
|
env:
|
||||||
- "2.6"
|
- TOXENV=py26
|
||||||
- "2.7"
|
- TOXENV=py27
|
||||||
- "3.3"
|
- TOXENV=py32
|
||||||
- "3.4"
|
- TOXENV=py33
|
||||||
- "pypy"
|
- TOXENV=py34
|
||||||
install:
|
- TOXENV=pypy
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install aiohttp; fi
|
- TOXENV=pypy3
|
||||||
script: python setup.py test
|
install: pip install tox
|
||||||
branches:
|
script: tox
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ include NOTICE
|
|||||||
include README.rst
|
include README.rst
|
||||||
include THANKS
|
include THANKS
|
||||||
include requirements_dev.txt
|
include requirements_dev.txt
|
||||||
|
include requirements_test.txt
|
||||||
recursive-include tests *
|
recursive-include tests *
|
||||||
recursive-include examples *
|
recursive-include examples *
|
||||||
recursive-include docs *
|
recursive-include docs *
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ coverage:
|
|||||||
venv/bin/python setup.py test --cov
|
venv/bin/python setup.py test --cov
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf .Python MANIFEST build dist venv* *.egg-info
|
@rm -rf .Python MANIFEST build dist venv* *.egg-info *.egg
|
||||||
@find . -type f -name "*.py[co]" -delete
|
@find . -type f -name "*.py[co]" -delete
|
||||||
@find . -type d -name "__pycache__" -delete
|
@find . -type d -name "__pycache__" -delete
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
pytest==2.6.3
|
-r requirements_test.txt
|
||||||
pytest-cov==1.7.0
|
|
||||||
sphinx
|
sphinx
|
||||||
sphinx_rtd_theme
|
sphinx_rtd_theme
|
||||||
|
|||||||
2
requirements_test.txt
Normal file
2
requirements_test.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pytest==2.6.3
|
||||||
|
pytest-cov==1.7.0
|
||||||
4
setup.py
4
setup.py
@ -40,9 +40,9 @@ with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
|
|||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
# read dev requirements
|
# read dev requirements
|
||||||
fname = os.path.join(os.path.dirname(__file__), 'requirements_dev.txt')
|
fname = os.path.join(os.path.dirname(__file__), 'requirements_test.txt')
|
||||||
with open(fname) as f:
|
with open(fname) as f:
|
||||||
tests_require = list(map(lambda l: l.strip(), f.readlines()))
|
tests_require = [l.strip() for l in f.readlines()]
|
||||||
|
|
||||||
if sys.version_info[:2] < (3, 3):
|
if sys.version_info[:2] < (3, 3):
|
||||||
tests_require.append('mock')
|
tests_require.append('mock')
|
||||||
|
|||||||
15
tox.ini
15
tox.ini
@ -1,11 +1,12 @@
|
|||||||
# 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.
|
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py26, py27, py33, pypy
|
envlist = py26, py27, py32, py33, py34, pypy, pypy3
|
||||||
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
usedevelop = True
|
||||||
commands = py.test tests/
|
commands = py.test tests/
|
||||||
deps = pytest
|
deps =
|
||||||
|
-rrequirements_test.txt
|
||||||
|
py26: unittest2
|
||||||
|
py2{6,7},pypy,py32,pypy3: mock
|
||||||
|
py3{3,4}: aiohttp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user