Skip to content

Commit

Permalink
Adding testing and coverage functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
CyclingNinja committed Feb 27, 2024
1 parent 36344fe commit e8329e8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 44 deletions.
11 changes: 11 additions & 0 deletions {{ cookiecutter.package_name }}/.codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
comment: off
coverage:
status:
project:
default:
threshold: 0.2%

codecov:
require_ci_to_pass: false
notify:
wait_for_ci: true
34 changes: 34 additions & 0 deletions {{ cookiecutter.package_name }}/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tool.coverage.run]
omit = [
"{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*",
"{{ cookiecutter.module_name }}/conftest.py",
"{{ cookiecutter.module_name }}/*setup_package*",
"{{ cookiecutter.module_name }}/tests/*",
"{{ cookiecutter.module_name }}/*/tests/*",
"{{ cookiecutter.module_name }}/extern/*",
"{{ cookiecutter.module_name }}/version*",
"*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*",
"*/{{ cookiecutter.module_name }}/conftest.py",
"*/{{ cookiecutter.module_name }}/*setup_package*",
"*/{{ cookiecutter.module_name }}/tests/*",
"*/{{ cookiecutter.module_name }}/*/tests/*",
"*/{{ cookiecutter.module_name }}/extern/*",
"*/{{ cookiecutter.module_name }}/version*",
]

[tool.coverage.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}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_"
]
44 changes: 0 additions & 44 deletions {{ cookiecutter.package_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,47 +61,3 @@ write_to = "{{ cookiecutter.module_name }}/_version.py"
{%- else -%}
write_to = "{{ cookiecutter.module_name }}/version.py"
{%- endif %}

[tool.pytest.ini_options]
testpaths = [
"{{ cookiecutter.module_name }}",
"docs",
]
doctest_plus = "enabled"
text_file_format = "rst"
addopts = "--doctest-rst"

[tool.coverage.run]
omit = [
"{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*",
"{{ cookiecutter.module_name }}/conftest.py",
"{{ cookiecutter.module_name }}/*setup_package*",
"{{ cookiecutter.module_name }}/tests/*",
"{{ cookiecutter.module_name }}/*/tests/*",
"{{ cookiecutter.module_name }}/extern/*",
"{{ cookiecutter.module_name }}/version*",
"*/{{ cookiecutter.module_name }}/_{{ cookiecutter._parent_project }}_init*",
"*/{{ cookiecutter.module_name }}/conftest.py",
"*/{{ cookiecutter.module_name }}/*setup_package*",
"*/{{ cookiecutter.module_name }}/tests/*",
"*/{{ cookiecutter.module_name }}/*/tests/*",
"*/{{ cookiecutter.module_name }}/extern/*",
"*/{{ cookiecutter.module_name }}/version*",
]

[tool.coverage.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}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
]
8 changes: 8 additions & 0 deletions {{ cookiecutter.package_name }}/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tool.pytest.ini_options]
testpaths = [
"{{ cookiecutter.module_name }}",
"docs",
]
doctest_plus = "enabled"
text_file_format = "rst"
addopts = "--doctest-rst"

0 comments on commit e8329e8

Please sign in to comment.