From fbc8d14bec58035601b2bfd571c49993c9f907dc Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Sat, 18 Feb 2017 21:17:25 +0100 Subject: Configure pytest to run tests and coverage --- setup.cfg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'setup.cfg') diff --git a/setup.cfg b/setup.cfg index 757d3ddea..c8f1f9b87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,3 +28,22 @@ lint_disable=fixme,locally-disabled,file-ignored,duplicate-code exclude=.tox/*,utils/*,inventory/* max_line_length = 120 ignore = E501,T003 + +[tool:pytest] +norecursedirs = + .* + __pycache__ + cover + docs + # utils have its own config + utils +python_files = + # TODO(rhcarvalho): rename test files to follow a single pattern. "test*.py" + # is Python unittest's default, while pytest discovers both "test_*.py" and + # "*_test.py" by default. + test_*.py + *_tests.py +addopts = + --cov=. + --cov-report=term + --cov-report=html -- cgit v1.2.3 From 16ffe4d70f100c3a36dd44ded4e0a4ed47041741 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Sun, 19 Feb 2017 10:48:45 +0100 Subject: Replace nose with pytest --- setup.cfg | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'setup.cfg') diff --git a/setup.cfg b/setup.cfg index c8f1f9b87..e6bf2c5d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,20 +4,6 @@ # will need to generate wheels for each Python version that you support. universal=1 -[nosetests] -tests=roles/lib_openshift/src/test/unit, - roles/lib_utils/src/test/unit, - roles/openshift_master_facts/test, - test -verbosity=2 -with-coverage=1 -cover-html=1 -cover-inclusive=1 -cover-min-percentage=25 -cover-erase=1 -detailed-errors=1 -cover-branches=1 - [yamllint] excludes=.tox,utils,files -- cgit v1.2.3