From 7323ccffc08177e58029586482b65f6fc1c6a0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Thu, 11 Nov 2021 15:49:44 -0800 Subject: [PATCH 1/3] Adding some config for coverage --- setup.cfg | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.cfg b/setup.cfg index cd0d72ec68..9f618d7269 100644 --- a/setup.cfg +++ b/setup.cfg @@ -129,6 +129,19 @@ max-line-length = 120 ignore = E226,E402,W503 exclude = _astropy_init.py,version.py +[coverage:run] +omit = + astroquery/*_init* + astroquery/tests/* + astroquery/*/tests/* + astroquery/*setup* + astroquery/version* + */astroquery/*_init* + */astroquery/tests/* + */astroquery/*/tests/* + */astroquery/*setup* + */astroquery/version* + [entry_points] [options] From 8521806000a580d93c6c4dedd6a9513f0adc356e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 12 Nov 2021 12:37:40 -0800 Subject: [PATCH 2/3] Remove template file, we use setup.cfg for config --- astroquery/tests/coveragerc | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 astroquery/tests/coveragerc diff --git a/astroquery/tests/coveragerc b/astroquery/tests/coveragerc deleted file mode 100644 index bec7c291f8..0000000000 --- a/astroquery/tests/coveragerc +++ /dev/null @@ -1,31 +0,0 @@ -[run] -source = {packagename} -omit = - {packagename}/_astropy_init* - {packagename}/conftest* - {packagename}/cython_version* - {packagename}/setup_package* - {packagename}/*/setup_package* - {packagename}/*/*/setup_package* - {packagename}/tests/* - {packagename}/*/tests/* - {packagename}/*/*/tests/* - {packagename}/version* - -[report] -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about packages we have installed - except ImportError - - # Don't complain if tests don't hit assertions - raise AssertionError - raise NotImplementedError - - # Don't complain about script hooks - def main\(.*\): - - # Ignore branches that don't pertain to this version of Python - pragma: py{ignore_python_version} \ No newline at end of file From 1cdd0cef9fa89391c844833feaf1c5c05aefbd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Fri, 12 Nov 2021 12:38:21 -0800 Subject: [PATCH 3/3] Specifying coverage config for tox --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 840cd4cdd4..461dc4aae8 100644 --- a/tox.ini +++ b/tox.ini @@ -48,7 +48,7 @@ commands = pip freeze # FIXME: there are too many failures in the docs example gallery, ignore it for now !cov: pytest --pyargs astroquery {toxinidir}/docs --ignore={toxinidir}/docs/gallery* {posargs} - cov: pytest --pyargs astroquery {toxinidir}/docs --ignore={toxinidir}/docs/gallery* --cov astroquery {posargs} + cov: pytest --pyargs astroquery {toxinidir}/docs --ignore={toxinidir}/docs/gallery* --cov astroquery --cov-config={toxinidir}/setup.cfg {posargs} cov: coverage xml -o {toxinidir}/coverage.xml [testenv:codestyle]