]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Add a minimal coverage configuration
authorDenis Laxalde <denis@laxalde.org>
Sun, 21 Nov 2021 08:49:58 +0000 (09:49 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 21 Nov 2021 23:48:49 +0000 (00:48 +0100)
We use pytest-cov, as it enables running coverage with pytest in a
single command.
We exclude 'if TYPE_CHECKING:' and ellipsis lines from report.

.gitignore
psycopg/setup.py
pyproject.toml

index 06d808ac7acd287c6a5a7576d91900e2300118f0..7fac87251b07806f1f6aa949fb08509e2744d38c 100644 (file)
@@ -11,3 +11,5 @@ __pycache__/
 /psycopg_binary/
 .vscode
 .venv
+.coverage
+htmlcov
index 6da0b852268fccc48958dde8f65f799cf27c123a..23341bfd988c72cb1b2b4cd58286a01d992ca879 100644 (file)
@@ -41,6 +41,7 @@ extras_require = {
         "pproxy ~= 2.7.8",
         "pytest ~= 6.2.5",
         "pytest-asyncio ~= 0.16.0",
+        "pytest-cov ~= 3.0.0",
         "pytest-randomly ~= 3.10.1",
         "tenacity ~= 8.0.1",
     ],
index 19ee39359b0f5169087226f36b5eff7a05c95a40..b05c86604fcb23e1c52a7f6c8478c5ee22e16cbc 100644 (file)
@@ -18,6 +18,16 @@ testpaths=[
 # log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s"
 # log_level = "DEBUG"
 
+[tool.coverage.run]
+source = [
+    "psycopg/psycopg",
+    "psycopg_pool/psycopg_pool",
+]
+[tool.coverage.report]
+exclude_lines = [
+    "if TYPE_CHECKING:",
+    '\.\.\.$',
+]
 
 [tool.mypy]
 files = [