From 40fa2126b5a44716d08e451ea534fc374918c262 Mon Sep 17 00:00:00 2001 From: Jamie Rasmussen Date: Thu, 10 Oct 2024 23:10:48 -0500 Subject: [PATCH] chore: add pytest code coverage report --- .gitignore | 1 + noxfile.py | 10 +++++++++- pyproject.toml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8b0cffa54e7..bfd2c66ffcc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ gha-creds-*.json .env .ruff_cache .pytest_cache +.coverage .nox *.log */file::memory:?cache=shared diff --git a/noxfile.py b/noxfile.py index 1f0817f4cfe..38552a9c36f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -72,7 +72,15 @@ def tests(session, shard): if shard == "llamaindex": session.posargs.insert(0, "-n4") - session.run("pytest", *session.posargs, *test_dirs, env=env) + session.run( + "pytest", + "--cov=weave", + "--cov-report=html", + "--cov-branch", + *session.posargs, + *test_dirs, + env=env, + ) # Configure pytest diff --git a/pyproject.toml b/pyproject.toml index bfe44c21cab..605ceabb8ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,7 @@ test = [ "nox", "pytest>=8.2.0", "pytest-asyncio>=0.23.6", + "pytest-cov>=5.0.0", "pytest-xdist>=3.1.0", "pytest-rerunfailures>=12.0", "clickhouse_connect==0.7.0",