diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 5724e30..0000000 --- a/.coveragerc +++ /dev/null @@ -1,34 +0,0 @@ -# This file contains settings for coverage.py - -[run] -# Change to True some day? -branch = False -# branch = True -omit = - tests/* - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Re-enable the standard pragma - pragma: no cover - - # Ignore defensive assertions - raise NotImplementedError - - # Ignore debugging representations. - def __str__ - def __repr__ - - # Exclude code that can't be executed. - if 0: - if False: - if __name__ == .__main__.: - - # Exclude stuff for debugging - if self\.config\['DEBUG'\]: - if self\.debug: - - # Ignore import exceptions - except ImportError: - diff --git a/pyproject.toml b/pyproject.toml index e6d1406..2c1897f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,3 +84,21 @@ skip-magic-trailing-comma = true [tool.ruff.lint.isort] combine-as-imports = true split-on-trailing-comma = false + +[tool.coverage.run] +branch = false +omit = ["tests/*"] + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "raise NotImplementedError", + "def __str__", + "def __repr__", + "if 0:", + "if False:", + "if __name__ == .__main__.:", + "if self\\.config\\['DEBUG'\\]:", + "if self\\.debug:", + "except ImportError:", +] diff --git a/tox.ini b/tox.ini index abf6e29..65a9be0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,4 +8,4 @@ deps= pytest-timeout PyYAML commands= - pytest --cov-report term-missing --cov-config .coveragerc --cov multipart --timeout=30 tests + pytest --cov-report term-missing --cov-config pyproject.toml --cov multipart --timeout=30 tests