Add type hints to test.test_fields
MODIFY
noxfile.py
noxfile.py
@@ -169,6 +169,7 @@ def mypy(session: nox.Session) -> None:
"test/__init__.py",
"test/conftest.py",
"test/port_helpers.py",
+ "test/test_fields.py",
"test/test_retry.py",
"test/test_wait.py",
"test/tz_stub.py",

MODIFY
src/urllib3/fields.py
src/urllib3/fields.py
@@ -18,7 +18,9 @@ _TYPE_FIELD_VALUE_TUPLE = Union[
]
-def guess_content_type(filename: str, default: str = "application/octet-stream") -> str:
+def guess_content_type(
+ filename: Optional[str], default: str = "application/octet-stream"
+) -> str:
"""
Guess the "Content-Type" of a file.

Add type hints to test.test_fields