Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.

Commit e29771f

Browse files
committed
Switch to tox for unit test execution.
1 parent 23af617 commit e29771f

File tree

6 files changed

+53
-15
lines changed

6 files changed

+53
-15
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
branch = True
3+
omit =
4+
.tox/*
5+
setup.py

.travis.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
language: python
2+
3+
# Python 3.5 specified to make tox environment 'py35' work.
4+
# See: https://github.com/travis-ci/travis-ci/issues/4794
25
python:
36
- 3.5
4-
- 3.4
5-
- 3.3
6-
- 2.7
7+
8+
# Environment changes have to be manually synced with 'tox.ini'.
9+
# See: https://github.com/travis-ci/travis-ci/issues/3024
10+
env:
11+
- TOXENV=py27
12+
- TOXENV=py33
13+
- TOXENV=py34
14+
- TOXENV=py35
15+
- TOXENV=pypy
16+
717
install:
8-
- pip install -r requirements.txt
9-
- pip install codecov
10-
- pip install flake8 pep8-naming flake8-quotes flake8-import-order
11-
before_script:
12-
flake8 --max-line-length=99 --import-order-style=google
18+
- pip install tox
19+
1320
script:
14-
python -Werror -m coverage run test.py
15-
after_success:
16-
codecov
21+
tox

requirements-dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flake8<3.0.0
2+
pep8-naming
3+
flake8-quotes
4+
flake8-import-order
5+
pytest
6+
pytest-cov

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
exitstatus
1+
exitstatus>1.0.0
22
typing

test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,3 @@ def write(self, s): # type: (str) -> None
130130

131131
sys.stderr = NullWriter()
132132
parse_arguments()
133-
134-
if __name__ == '__main__':
135-
unittest.main()

tox.ini

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[tox]
2+
# Environment changes have to be manually synced with '.travis.yml'.
3+
envlist =
4+
py27
5+
py33
6+
py34
7+
py35
8+
pypy
9+
10+
[flake8]
11+
max-line-length = 99
12+
import-order-style = google
13+
14+
[testenv]
15+
passenv = CI TRAVIS_BUILD_ID TRAVIS TRAVIS_BRANCH TRAVIS_JOB_NUMBER TRAVIS_PULL_REQUEST TRAVIS_JOB_ID TRAVIS_REPO_SLUG TRAVIS_COMMIT
16+
deps =
17+
-rrequirements-dev.txt
18+
codecov
19+
20+
commands =
21+
flake8
22+
# Ignore DeprecationWarning / PendingDeprecationWarning triggered by tox/virtualenv
23+
python -bb -Werror -Wignore::DeprecationWarning -Wignore::PendingDeprecationWarning \
24+
-m pytest --cov=./ test.py
25+
codecov -e TOXENV

0 commit comments

Comments
 (0)