From 0b5c49f2984b1a6fab4b9bf6fb9f62aec6da041f Mon Sep 17 00:00:00 2001 From: Virtual1ty Date: Tue, 17 Dec 2024 12:38:31 +0100 Subject: [PATCH] fix: Add coverage configuration to pyproject.toml (#1091) --- beanie/pydantic_check.py | 5 ----- pyproject.toml | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 beanie/pydantic_check.py diff --git a/beanie/pydantic_check.py b/beanie/pydantic_check.py deleted file mode 100644 index 76d03a94..00000000 --- a/beanie/pydantic_check.py +++ /dev/null @@ -1,5 +0,0 @@ -import pydantic - - -def is_second_version() -> bool: - return int(pydantic.VERSION.split(".")[0]) >= 2 diff --git a/pyproject.toml b/pyproject.toml index 7fa863c8..3272da37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,9 +76,24 @@ beanie = "beanie.executors.migrate:migrations" # TOOLS +[tool.coverage.run] +branch = true +source = ["beanie"] + +[tool.coverage.report] +ignore_errors = true +show_missing = true +fail_under = 80 +exclude_lines = [ + 'pragma: no cover', + 'if TYPE_CHECKING:', + 'if typing.TYPE_CHECKING:', + 'if __name__ == .__main__.:' +] + [tool.pytest.ini_options] minversion = "8.0" -addopts = "--cov-report term-missing --cov=beanie --cov-branch --cov-fail-under=80" +addopts = "--cov" testpaths = [ "tests", ]