Skip to content

Commit

Permalink
add tox configuration, and expose test runner via that
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Jun 13, 2018
1 parent 9c61cc1 commit 5f1c3cf
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dmypy.json
# Packages
*.egg
*.egg-info
*.eggs

# IDEs
.idea
Expand Down
2 changes: 1 addition & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def add_pytest(self, files: List[Tuple[str, str]], coverage: bool = True) -> Non
if not pytest_files:
return
pytest_args = pytest_files + self.arglist + self.pyt_arglist
always_append = ['-n', 'auto', '--cov-append', ' --cov-report=']
always_append = ['-n', 'auto', '--cov-append', '--cov-report=']
if coverage and self.coverage:
args = [sys.executable, '-m', 'pytest', '--cov=mypy'] + always_append + pytest_args
else:
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ exclude =
typeshed/*,
# during runtests.py flake8 might be started when there's still examples in the temp dir
tmp-test-dirs/*

.tox
.eggs

# Things to ignore:
# E251: spaces around default arg value (against our style)
Expand Down
40 changes: 40 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[tox]
minversion = 2.9.1
skip_missing_interpreters = true
envlist = py34,
py35,
py36,
py37,
lint,
type,
docs

[testenv]
description = run the test driver with {basepython}
deps = -r ./test-requirements.txt
commands = python runtests.py -x lint -x package {posargs}

[testenv:lint]
description = check the code style
basepython = python3.6
commands = python runtests.py lint {posargs}

[testenv:type]
description = type check ourselves
basepython = python3.6
commands = python runtests.py testselfcheck -p '-n0' -p '-v'

[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.6
deps = -r docs/requirements-docs.txt
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -W -bhtml {posargs}

[testenv:dev]
description = generate a DEV environment, that has all project libraries
usedevelop = True
basepython = python3.6
deps = -r ./test-requirements.txt
-r docs/requirements-docs.txt
commands = python -m pip list --format=columns
python -c 'import sys; print(sys.executable)'

0 comments on commit 5f1c3cf

Please sign in to comment.