From cb838682fe1850e2b6c42f6b8a882b8fbe3cd157 Mon Sep 17 00:00:00 2001 From: Daan Debie Date: Fri, 1 Sep 2017 13:53:02 +0200 Subject: [PATCH] Configure pytest and add setup.py test command --- setup.cfg | 8 +++++++- setup.py | 2 ++ tox.ini | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 82492977..1253c144 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,4 +8,10 @@ exclude = dist, build, tests -max-line-length=100 \ No newline at end of file +max-line-length=100 + +[aliases] +test=pytest + +[tool:pytest] +addopts = --cov-config .coveragerc --verbose --cov-report term-missing --cov=machine \ No newline at end of file diff --git a/setup.py b/setup.py index d6507b1f..eb5617ac 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,8 @@ def run(self): url=about["__uri__"], author=about["__author__"], author_email=about["__email__"], + setup_requires=['pytest-runner'], + tests_require=['pytest', 'pytest-cov', 'coverage'], classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", diff --git a/tox.ini b/tox.ini index 85d7648b..16bc1158 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ deps =-r{toxinidir}/requirements-dev.txt [testenv:py36] passenv = CI TRAVIS TRAVIS_* -commands = pytest --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=machine tests +commands = pytest --cov-config .coveragerc --verbose --cov-report term-missing --cov-report xml --cov=machine tests [testenv:flake8] deps = flake8