summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mypy-requirements.txt2
-rw-r--r--src/urllib3/connection.py5
-rw-r--r--test/with_dummyserver/test_https.py6
3 files changed, 7 insertions, 6 deletions
diff --git a/mypy-requirements.txt b/mypy-requirements.txt
index 29192760..f15629e4 100644
--- a/mypy-requirements.txt
+++ b/mypy-requirements.txt
@@ -1,4 +1,4 @@
-mypy==0.971
+mypy==0.981
idna>=2.0.0
cryptography>=1.3.4
tornado>=6.1
diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py
index 172373f0..9d7a97fc 100644
--- a/src/urllib3/connection.py
+++ b/src/urllib3/connection.py
@@ -12,6 +12,7 @@ from typing import (
TYPE_CHECKING,
Any,
Callable,
+ ClassVar,
Iterable,
Mapping,
NamedTuple,
@@ -132,7 +133,7 @@ class HTTPConnection(_HTTPConnection):
source_address: Optional[Tuple[str, int]]
socket_options: Optional[connection._TYPE_SOCKET_OPTIONS]
_tunnel_host: Optional[str]
- _tunnel: Callable[["HTTPConnection"], None]
+ _tunnel: ClassVar[Callable[["HTTPConnection"], None]]
_connecting_to_proxy: bool
def __init__(
@@ -173,7 +174,7 @@ class HTTPConnection(_HTTPConnection):
# However, there is also a `host` setter so LSP is not violated.
# Potentially, a `@host.deleter` might be needed depending on how this issue will be fixed.
@property # type: ignore[override]
- def host(self) -> str: # type: ignore[override]
+ def host(self) -> str:
"""
Getter method to remove any trailing dots that indicate the hostname is an FQDN.
diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py
index 4dc797eb..e48da216 100644
--- a/test/with_dummyserver/test_https.py
+++ b/test/with_dummyserver/test_https.py
@@ -460,7 +460,7 @@ class TestHTTPS(HTTPSDummyServerTestCase):
# socket, so only add this assertion if the attribute is there (i.e.
# the python ssl module).
if hasattr(conn.sock, "server_hostname"):
- assert conn.sock.server_hostname == "localhost"
+ assert conn.sock.server_hostname == "localhost" # type: ignore[union-attr]
def test_assert_fingerprint_md5(self) -> None:
with HTTPSConnectionPool(
@@ -781,7 +781,7 @@ class TestHTTPS(HTTPSDummyServerTestCase):
conn.connect()
if not hasattr(conn.sock, "version"):
pytest.skip("SSLSocket.version() not available")
- assert conn.sock.version() == self.tls_protocol_name
+ assert conn.sock.version() == self.tls_protocol_name # type: ignore[union-attr]
finally:
conn.close()
@@ -879,7 +879,7 @@ class TestHTTPS(HTTPSDummyServerTestCase):
conn = https_pool._get_conn()
try:
conn.connect()
- assert conn.sock.version() == self.tls_protocol_name
+ assert conn.sock.version() == self.tls_protocol_name # type: ignore[union-attr]
finally:
conn.close()