Taken from https://github.com/encode/httpcore/pull/156
Added as a followup of https://github.com/encode/httpx/pull/1177#issuecomment-
674252582
"__description__",
"__title__",
"__version__",
- "delete",
- "get",
- "head",
- "options",
- "patch",
- "post",
- "patch",
- "put",
- "request",
- "stream",
- "codes",
"ASGITransport",
"AsyncClient",
"Auth",
"BasicAuth",
"Client",
- "DigestAuth",
- "Limits",
- "PoolLimits",
- "Proxy",
- "Timeout",
- "create_ssl_context",
"CloseError",
+ "codes",
"ConnectError",
"ConnectTimeout",
"CookieConflict",
+ "Cookies",
+ "create_ssl_context",
"DecodingError",
+ "delete",
+ "DigestAuth",
+ "get",
+ "head",
+ "Headers",
"HTTPError",
"HTTPStatusError",
"InvalidURL",
- "UnsupportedProtocol",
+ "Limits",
"LocalProtocolError",
- "RemoteProtocolError",
"NetworkError",
"NotRedirectResponse",
+ "options",
+ "patch",
+ "PoolLimits",
"PoolTimeout",
+ "post",
"ProtocolError",
+ "Proxy",
+ "ProxyError",
+ "put",
+ "QueryParams",
"ReadError",
"ReadTimeout",
- "RequestError",
+ "RemoteProtocolError",
+ "request",
+ "Request",
"RequestBodyUnavailable",
+ "RequestError",
+ "RequestNotRead",
+ "Response",
"ResponseClosed",
"ResponseNotRead",
- "RequestNotRead",
"StatusCode",
+ "stream",
"StreamConsumed",
"StreamError",
- "ProxyError",
+ "Timeout",
"TimeoutException",
"TooManyRedirects",
"TransportError",
- "WriteError",
- "WriteTimeout",
+ "UnsupportedProtocol",
"URL",
- "URLLib3Transport",
"URLLib3ProxyTransport",
- "Cookies",
- "Headers",
- "QueryParams",
- "Request",
- "Response",
- "DigestAuth",
+ "URLLib3Transport",
+ "WriteError",
+ "WriteTimeout",
"WSGITransport",
]
-_locals = locals()
-for _name in __all__:
- if not _name.startswith("__"):
- setattr(_locals[_name], "__module__", "httpx") # noqa
+__locals = locals()
+for __name in __all__:
+ if not __name.startswith("__"):
+ setattr(__locals[__name], "__module__", "httpx") # noqa
--- /dev/null
+import httpx
+from httpx import __all__ as exported_members
+
+
+def test_all_imports_are_exported() -> None:
+ included_private_members = ["__description__", "__title__", "__version__"]
+ assert exported_members == sorted(
+ (
+ member
+ for member in vars(httpx).keys()
+ if not member.startswith("_") or member in included_private_members
+ ),
+ key=str.casefold,
+ )