Skip to content

Commit

Permalink
Fix coverage precision to 96.77% (encode#1351)
Browse files Browse the repository at this point in the history
* Fix coverage precision to 96.83%

* Add conditional coverage rule

* Modify fail-under to check if 3.7 passes
  • Loading branch information
Kludex committed Oct 29, 2022
1 parent b902ab4 commit ee4e624
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/coverage
Original file line number Diff line number Diff line change
Expand Up @@ -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.77
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ include = uvicorn/*, tests/*
plugins =
coverage_conditional_plugin

[coverage:report]
precision = 2

[coverage:coverage_conditional_plugin]
rules =
"sys_platform == 'win32'": py-win32
"sys_version_info >= (3, 8)": py-gte-38
"sys_version_info < (3, 8)": py-lt-38
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee4e624

Please sign in to comment.