Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage: pin higher coverage #1006

Merged
merged 7 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/coverage
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh -e

export PREFIX=""
if [ -d 'venv' ] ; then
if [ -d 'venv' ]; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="uvicorn tests"

set -x

${PREFIX}coverage report --show-missing --skip-covered --fail-under=80
${PREFIX}coverage report --show-missing --skip-covered --fail-under=95
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

export PREFIX=""
if [ -d 'venv' ] ; then
if [ -d 'venv' ]; then
export PREFIX="venv/bin/"
fi

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_packages(package):

extra_requirements = [
"websockets>=8.*",
"httptools==0.2.* ;" + env_marker_cpython,
"httptools==0.2.*",
"uvloop>=0.14.0,!=0.15.0,!=0.15.1; " + env_marker_cpython,
"colorama>=0.4;" + env_marker_win,
"watchgod>=0.6",
Expand Down
4 changes: 2 additions & 2 deletions tests/protocols/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_get_local_addr_with_socket():
)
assert get_local_addr(transport) == ("123.45.6.7", 123)

if hasattr(socket, "AF_UNIX"):
if hasattr(socket, "AF_UNIX"): # pragma: no cover
transport = MockTransport(
{"socket": MockSocket(family=socket.AF_UNIX, sockname=("127.0.0.1", 8000))}
)
Expand All @@ -61,7 +61,7 @@ def test_get_remote_addr_with_socket():
)
assert get_remote_addr(transport) == ("123.45.6.7", 123)

if hasattr(socket, "AF_UNIX"):
if hasattr(socket, "AF_UNIX"): # pragma: no cover
transport = MockTransport(
{"socket": MockSocket(family=socket.AF_UNIX, peername=("127.0.0.1", 8000))}
)
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/loops/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys


def asyncio_setup():
def asyncio_setup(): # pragma: no cover
if (
sys.version_info.major >= 3
and sys.version_info.minor >= 8
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/loops/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def auto_loop_setup():
from uvicorn.loops.asyncio import asyncio_setup as loop_setup

loop_setup()
else:
else: # pragma: no cover
from uvicorn.loops.uvloop import uvloop_setup

uvloop_setup()
2 changes: 1 addition & 1 deletion uvicorn/protocols/http/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from uvicorn.protocols.http.h11_impl import H11Protocol

AutoHTTPProtocol = H11Protocol
else:
else: # pragma: no cover
from uvicorn.protocols.http.httptools_impl import HttpToolsProtocol

AutoHTTPProtocol = HttpToolsProtocol
2 changes: 1 addition & 1 deletion uvicorn/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def install_signal_handlers(self) -> None:
try:
for sig in HANDLED_SIGNALS:
loop.add_signal_handler(sig, self.handle_exit, sig, None)
except NotImplementedError:
except NotImplementedError: # pragma: no cover
# Windows
for sig in HANDLED_SIGNALS:
signal.signal(sig, self.handle_exit)
Expand Down