From dea77ef325bc81a465180ca0db73409641abbaae Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 1 Feb 2022 14:40:46 +0100 Subject: [PATCH 1/3] Fix coverage precision to 96.83% --- scripts/coverage | 2 +- setup.cfg | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/coverage b/scripts/coverage index 8846cf08c..0fa8c1bfb 100755 --- a/scripts/coverage +++ b/scripts/coverage @@ -8,4 +8,4 @@ export SOURCE_FILES="uvicorn tests" set -x -${PREFIX}coverage report --show-missing --skip-covered --fail-under=97 +${PREFIX}coverage report --show-missing --skip-covered --fail-under=96.83 diff --git a/setup.cfg b/setup.cfg index 46dd82a18..bdbea60f9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,6 +71,9 @@ include = uvicorn/*, tests/* plugins = coverage_conditional_plugin +[coverage:report] +precision = 2 + [coverage:coverage_conditional_plugin] rules = "sys_platform == 'win32'": py-win32 From 18e9ba851b75f8256219fff2673a956867f83a4f Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 1 Feb 2022 14:45:45 +0100 Subject: [PATCH 2/3] Add conditional coverage rule --- setup.cfg | 1 + tests/test_config.py | 2 +- uvicorn/config.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index bdbea60f9..58832b22d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -78,3 +78,4 @@ precision = 2 rules = "sys_platform == 'win32'": py-win32 "sys_version_info >= (3, 8)": py-gte-38 + "sys_version_info < (3, 8)": py-lt-38 diff --git a/tests/test_config.py b/tests/test_config.py index 05a126ddb..cce386219 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -10,7 +10,7 @@ if sys.version_info < (3, 8): # pragma: py-gte-38 from typing_extensions import Literal -else: +else: # pragma: py-lt-38 from typing import Literal import pytest diff --git a/uvicorn/config.py b/uvicorn/config.py index fbc8462d1..40a431e80 100644 --- a/uvicorn/config.py +++ b/uvicorn/config.py @@ -14,7 +14,7 @@ if sys.version_info < (3, 8): # pragma: py-gte-38 from typing_extensions import Literal -else: +else: # pragma: py-lt-38 from typing import Literal import click From d21d1dfbf495da9ccaa0223635aefdef38d4e763 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 1 Feb 2022 15:00:08 +0100 Subject: [PATCH 3/3] Modify fail-under to check if 3.7 passes --- scripts/coverage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coverage b/scripts/coverage index 0fa8c1bfb..3207d9719 100755 --- a/scripts/coverage +++ b/scripts/coverage @@ -8,4 +8,4 @@ export SOURCE_FILES="uvicorn tests" set -x -${PREFIX}coverage report --show-missing --skip-covered --fail-under=96.83 +${PREFIX}coverage report --show-missing --skip-covered --fail-under=96.77