From 532a74cc9f758b70838f67aa049a2dc701b8d371 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Mon, 5 Feb 2024 12:31:45 +0300 Subject: [PATCH 1/2] chore: move coverage settings to coverage cfg --- .coveragerc | 3 +++ pytest.ini | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 0e3ab35..cd4ef8f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,9 @@ # .coveragerc to control coverage.py [run] branch = True +include = + aiohttp_sse/ + tests/ [report] exclude_also = diff --git a/pytest.ini b/pytest.ini index b844934..8218926 100644 --- a/pytest.ini +++ b/pytest.ini @@ -9,7 +9,7 @@ addopts = # show values of the local vars in errors: --showlocals # coverage reports - --cov=aiohttp_sse/ --cov=tests/ --cov-report term + --cov-config=.coveragerc --cov-report term asyncio_mode = auto filterwarnings = error From d59539fd363d61b7f166b7bbee622ca27e802504 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Mon, 5 Feb 2024 14:25:53 +0300 Subject: [PATCH 2/2] coverage orchestrate testing --- .coveragerc | 4 ++-- .github/workflows/ci.yml | 4 ++-- pytest.ini | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index cd4ef8f..ea8f196 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,8 +2,8 @@ [run] branch = True include = - aiohttp_sse/ - tests/ + aiohttp_sse/* + tests/* [report] exclude_also = diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ddca51c..f0a55c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,10 +57,10 @@ jobs: with: path: requirements.txt - name: Run unittests - run: pytest tests + run: coverage run -m pytest ./tests env: COLOR: 'yes' - - run: python -m coverage xml + - run: coverage xml - name: Upload coverage uses: codecov/codecov-action@v3 with: diff --git a/pytest.ini b/pytest.ini index 8218926..0b66b40 100644 --- a/pytest.ini +++ b/pytest.ini @@ -8,8 +8,6 @@ addopts = -ra # show values of the local vars in errors: --showlocals - # coverage reports - --cov-config=.coveragerc --cov-report term asyncio_mode = auto filterwarnings = error