From 5a167c358e4037aed8f3444154c0107d5fa58027 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sun, 30 Jun 2024 22:35:14 +0200 Subject: [PATCH] Add pytest & coverage settings --- pyproject.toml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index da0e17e..424d85f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,3 +148,35 @@ reportUnnecessaryContains = "error" reportUnnecessaryTypeIgnoreComment = "error" reportImplicitOverride = "error" reportShadowedImports = "error" + +[tool.pytest.ini_options] +minversion = "6.0" +asyncio_mode = "auto" +testpaths = ["tests"] +addopts = "--strict-markers --cov --no-cov-on-fail" + +[tool.coverage.report] +precision = 2 +fail_under = 20 +show_missing = true +skip_covered = false +skip_empty = false +sort = "cover" +exclude_lines = [ + "\\#\\s*pragma: no cover", + "^\\s*if (typing\\.)?TYPE_CHECKING:", + "^\\s*@(abc\\.)?abstractmethod", + "^\\s*@(typing\\.)?overload", + "^\\s*def __repr__\\(", + "^\\s*class .*\\bProtocol\\):", + "^\\s*raise NotImplementedError", + "^\\s*return NotImplemented", + "^\\s*\\.\\.\\.", +] + +[tool.coverage.run] +relative_files = true +parallel = true +branch = true +timid = false +source = ["src"]