Skip to content

Commit 278c207

Browse files
committed
configure pytest, and coverage
1 parent 602f007 commit 278c207

File tree

2 files changed

+52
-14
lines changed

2 files changed

+52
-14
lines changed

.travis.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
11
dist: xenial
22
language: python
33

4-
python:
5-
- '2.7'
6-
- '3.4'
7-
- '3.5'
8-
- '3.6'
9-
- '3.7'
10-
- 'pypy2.7-6.0'
11-
- 'pypy3.5-6.0'
4+
env:
5+
global:
6+
- PYTEST_ADDOPTS="--cov --cov-report=xml"
7+
8+
jobs:
9+
include:
10+
- python: '2.7'
11+
env: TOXENV=py27-coverage
12+
- python: '3.4'
13+
env: TOXENV=py34-coverage
14+
- python: '3.5'
15+
env: TOXENV=py35-coverage
16+
- python: '3.6'
17+
env: TOXENV=py36-coverage
18+
- python: '3.7'
19+
env: TOXENV=py37-coverage
20+
- python: 'pypy2.7-6.0'
21+
env: TOXENV=pypy-coverage
22+
- python: 'pypy3.5-6.0'
23+
env: TOXENV=pypy3-coverage
24+
# Fails currently badly.
25+
# - python: '3.7'
26+
# env: TOXENV=qa
1227

1328
install:
14-
- pip install tox-travis
29+
- pip install tox
1530

1631
script:
1732
- tox
1833

34+
after_script:
35+
- |
36+
if [[ "${TOXENV%-coverage}" != "$TOXENV" ]]; then
37+
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV
38+
fi
39+
1940
# Only master and releases. PRs are used otherwise.
2041
branches:
2142
only:

tox.ini

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
[tox]
2-
envlist = py27, py34, py35, py36, py37, flake8, pypy, pypy3
2+
envlist = py{27,34,35,36,37,py,py3}, flake8
33

44
[testenv]
5-
deps=
5+
deps =
66
pytest
77
pexpect
8-
commands=
9-
py.test --junitxml={envdir}/junit.xml []
8+
coverage: pytest-cov
9+
commands =
10+
pytest {posargs}
1011
passenv =
1112
TERM
13+
setenv =
14+
coverage: PYTEST_ADDOPTS=--cov {env:PYTEST_ADDOPTS:}
1215

13-
[testenv:flake8]
16+
[testenv:qa]
1417
deps =
1518
flake8
1619
mccabe
1720
commands = flake8 --max-complexity=10 setup.py pyrepl testing pythoni pythoni1
21+
22+
[pytest]
23+
testpaths = testing
24+
25+
[coverage:run]
26+
include = pyrepl/*, testing/*
27+
parallel = 1
28+
branch = 1
29+
30+
[coverage:paths]
31+
source = pyrepl/
32+
*/lib/python*/site-packages/pyrepl/
33+
*/pypy*/site-packages/pyrepl/
34+
*\Lib\site-packages\pyrepl\

0 commit comments

Comments
 (0)