Skip coverage on breaks right before returns for Python 3.8 (#226)

This commit is contained in:
Seth Michael Larson 2019-08-17 13:19:08 -05:00 committed by GitHub
parent 21939fdaa8
commit 43f66d5756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -22,9 +22,6 @@ matrix:
- python: 3.8-dev
env: NOX_SESSION=test-3.8
allow_failures:
- python: 3.8-dev
install:
- pip install --upgrade nox

View File

@ -148,7 +148,7 @@ class SSLConfig:
if ssl.HAS_ALPN:
context.set_alpn_protocols(["h2", "http/1.1"])
if ssl.HAS_NPN:
if ssl.HAS_NPN: # pragma: no cover
context.set_npn_protocols(["h2", "http/1.1"])
return context

View File

@ -129,7 +129,7 @@ class HTTP11Connection:
continue
else:
assert isinstance(event, h11.Response)
break
break # pragma: no cover
http_version = "HTTP/%s" % event.http_version.decode("latin-1", errors="ignore")
return http_version, event.status_code, event.headers
@ -145,7 +145,7 @@ class HTTP11Connection:
yield bytes(event.data)
else:
assert isinstance(event, h11.EndOfMessage)
break
break # pragma: no cover
async def _receive_event(self, timeout: TimeoutConfig = None) -> H11Event:
"""
@ -162,7 +162,8 @@ class HTTP11Connection:
data = b""
self.h11_state.receive_data(data)
else:
break
assert event is not h11.NEED_DATA
break # pragma: no cover
return event
async def response_closed(self) -> None: