Skip to content

Commit a387aa0

Browse files
committed
fix: Add Python 3.7 specific coverage configuration
- Create .coveragerc-py37 to exclude aio module from coverage on Python 3.7 - Use --cov-config flag to specify this file for py37 environments only - This prevents the aio module exclusion from affecting Python 3.8+ tests
1 parent dee798e commit a387aa0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.coveragerc-py37

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[run]
2+
# Coverage configuration specifically for Python 3.7 environments
3+
# Excludes the aio module which requires Python 3.8+ (Starlette dependency)
4+
# This file is only used by py37-* tox environments
5+
omit =
6+
*/functions_framework/aio/*
7+
*/.tox/*
8+
*/tests/*
9+
*/venv/*
10+
*/.venv/*

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extras =
3333
async
3434
setenv =
3535
PYTESTARGS = --cov=functions_framework --cov-branch --cov-report term-missing --cov-fail-under=100
36-
# Python 3.7: Exclude aio module from coverage since it requires Python 3.8+ (Starlette dependency)
37-
py37-ubuntu-22.04: PYTESTARGS = --cov=functions_framework --cov-branch --cov-report term-missing --cov-fail-under=100 --cov-omit='*/aio/*'
38-
py37-macos-13: PYTESTARGS = --cov=functions_framework --cov-branch --cov-report term-missing --cov-fail-under=100 --cov-omit='*/aio/*'
36+
# Python 3.7: Use .coveragerc-py37 to exclude aio module from coverage since it requires Python 3.8+ (Starlette dependency)
37+
py37-ubuntu-22.04: PYTESTARGS = --cov=functions_framework --cov-config=.coveragerc-py37 --cov-branch --cov-report term-missing --cov-fail-under=100
38+
py37-macos-13: PYTESTARGS = --cov=functions_framework --cov-config=.coveragerc-py37 --cov-branch --cov-report term-missing --cov-fail-under=100
3939
py37-windows-latest: PYTESTARGS =
4040
windows-latest: PYTESTARGS =
4141
commands = pytest {env:PYTESTARGS} {posargs}

0 commit comments

Comments
 (0)