Skip to content

Commit 6d892c6

Browse files
authored
Merge pull request #48 from steenzout/tox
tox
2 parents 1865713 + 489c15a commit 6d892c6

File tree

8 files changed

+101
-21
lines changed

8 files changed

+101
-21
lines changed

.gitignore

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22
*.py[co]
33
*.egg-info
44
build
5-
dist
6-
venv
5+
sdist
6+
7+
__pycache__/
8+
9+
# virtualenv
10+
venv/
711

812
# Sphinx documentation
913
docs/_build
14+
15+
# Unit test / coverage reports
16+
htmlcov/
17+
.tox/
18+
.coverage
19+
.coverage.*
20+
.cache
21+
coverage.xml
22+
tests/junit.xml

.travis.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
language: python
22

3+
branches:
4+
except:
5+
- gh-pages
6+
7+
cache:
8+
directories:
9+
- "${HOME}/virtualenv"
10+
- "${TRAVIS_BUILD_DIR}/.tox"
11+
312
python:
413
- 2.6
514
- 2.7
615
- 3.3
716
- 3.4
17+
- 3.5
18+
- 3.6
819
- pypy
920

10-
env:
11-
- PYTEST=2.3.5
12-
- PYTEST=2.4.2
13-
- PYTEST=2.5.2
14-
- PYTEST=2.6.4
15-
- PYTEST=2.7.0
16-
- PYTEST=2.7.1
17-
- PYTEST=2.7.2
18-
- PYTEST=2.7.3
19-
- PYTEST=2.8.0
21+
matrix:
22+
fast_finish: true
23+
allow_failures:
24+
- python: 3.6
25+
- python: 3.5
2026

2127
install:
22-
- pip install -q pytest==$PYTEST
23-
- pip install -q -r requirements/main.txt
24-
- pip install -q -e .
28+
- pip install tox
29+
- pip install tox-travis
2530

2631
script:
27-
- py.test
32+
- tox
33+
- "find ${TRAVIS_BUILD_DIR}/.tox -name log -o -name __pycache__ -type d | xargs -I {} rm -rf {}"
34+

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include README.rst
22
include LICENSE
3+
include tox.ini
34

45
recursive-include requirements *.txt
56
recursive-include docs *

pytest_flask/fixtures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def __init__(self, app, port):
5656

5757
def start(self):
5858
"""Start application in a separate process."""
59-
worker = lambda app, port: app.run(port=port, use_reloader=False)
59+
def worker(app, port):
60+
app.run(port=port, use_reloader=False)
6061
self._process = multiprocessing.Process(
6162
target=worker,
6263
args=(self.app, self.port)

requirements/main.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Flask
2-
Werkzeug>=0.7
3-
pytest>=2.4
2+
Werkzeug>=0.7

requirements/test.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mock
2+
pylint
3+
pytest-cov
4+
pytest-pep8
5+
pytest-xdist

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_version():
127127

128128

129129
version = get_version()
130-
requirements = read('requirements', 'main.txt').splitlines()
130+
requirements = read('requirements', 'main.txt').splitlines() + ['pytest']
131131
tests_require = []
132132

133133
extras_require = {
@@ -179,7 +179,7 @@ def get_version():
179179
],
180180

181181
# The following makes a plugin available to pytest
182-
entry_points = {
182+
entry_points={
183183
'pytest11': [
184184
'flask = pytest_flask.plugin',
185185
]

tox.ini

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[tox]
2+
envlist =
3+
py{36,35,34,33,27,26}-pytest{30,29,28,27,26}
4+
pypy-pytest{30,29,28,27,26}
5+
6+
7+
[pytest]
8+
norecursedirs = .git .tox env coverage docs
9+
pep8ignore =
10+
docs/conf.py ALL
11+
pep8maxlinelength = 119
12+
13+
14+
[testenv]
15+
usedevelop = True
16+
deps =
17+
-rrequirements/main.txt
18+
-rrequirements/test.txt
19+
pytest23: pytest>=2.3,<2.4
20+
pytest24: pytest>=2.4,<2.5
21+
pytest25: pytest>=2.5,<2.6
22+
pytest26: pytest>=2.6,<2.7
23+
24+
passenv = HOME LANG LC_ALL
25+
26+
commands =
27+
py.test -q --basetemp={envtmpdir} --confcutdir=.. -n 1 \
28+
--junitxml=tests/junit.xml \
29+
--cov-report xml --cov pytest_flask \
30+
--cov-report=html \
31+
--cov-report term-missing \
32+
--pep8 \
33+
-n 2 \
34+
{posargs}
35+
36+
37+
[testenv:docs]
38+
changedir = docs
39+
deps = -r../requirements/docs.txt
40+
41+
commands =
42+
make html
43+
44+
whitelist_externals =
45+
/usr/bin/make
46+
47+
48+
[tox:travis]
49+
2.6 = py26-pytest{30,29,28,27,26}
50+
2.7 = py27-pytest{30,29,28,27,26}
51+
3.3 = py33-pytest{30,29,28,27,26}
52+
3.4 = py34-pytest{30,29,28,27,26}
53+
3.5 = py35-pytest{30,29,28,27,26}
54+
3.6 = py36-pytest{30,29,28,27,26}

0 commit comments

Comments
 (0)