Skip to content
Myr

Add exported members test (#1179)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Taken from https://github.com/encode/httpcore/pull/156 Added as a followup of https://github.com/encode/httpx/pull/1177#issuecomment-674252582

authored by Josep Cugat · committed by GitHub · parent 1729e45 · Browse files · 2 files+47 added−35 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+47 added−35 removed

  • tests:+14 added−0 removed
  • other:+33 added−35 removed

2 files+47 added−35 removed

modified:httpx/__init__.py+33 added-35 removed
43 unmodified lines
44__all__ = [45 "__description__",46 "__title__",47 "__version__",48 "delete",49 "get",50 "head",51 "options",52 "patch",53 "post",54 "patch",55 "put",56 "request",57 "stream",58 "codes",48 "ASGITransport",49 "AsyncClient",50 "Auth",51 "BasicAuth",52 "Client",64 "DigestAuth",65 "Limits",66 "PoolLimits",67 "Proxy",68 "Timeout",69 "create_ssl_context",53 "CloseError",54 "codes",55 "ConnectError",56 "ConnectTimeout",57 "CookieConflict",58 "Cookies",59 "create_ssl_context",60 "DecodingError",61 "delete",62 "DigestAuth",63 "get",64 "head",65 "Headers",66 "HTTPError",67 "HTTPStatusError",68 "InvalidURL",78 "UnsupportedProtocol",69 "Limits",70 "LocalProtocolError",80 "RemoteProtocolError",71 "NetworkError",72 "NotRedirectResponse",73 "options",74 "patch",75 "PoolLimits",76 "PoolTimeout",77 "post",78 "ProtocolError",79 "Proxy",80 "ProxyError",81 "put",82 "QueryParams",83 "ReadError",84 "ReadTimeout",87 "RequestError",85 "RemoteProtocolError",86 "request",87 "Request",88 "RequestBodyUnavailable",89 "RequestError",90 "RequestNotRead",91 "Response",92 "ResponseClosed",93 "ResponseNotRead",91 "RequestNotRead",94 "StatusCode",95 "stream",96 "StreamConsumed",97 "StreamError",95 "ProxyError",98 "Timeout",99 "TimeoutException",100 "TooManyRedirects",101 "TransportError",99 "WriteError",100 "WriteTimeout",102 "UnsupportedProtocol",103 "URL",102 "URLLib3Transport",104 "URLLib3ProxyTransport",104 "Cookies",105 "Headers",106 "QueryParams",107 "Request",108 "Response",109 "DigestAuth",105 "URLLib3Transport",106 "WriteError",107 "WriteTimeout",108 "WSGITransport",109]110111114_locals = locals()115for _name in __all__:116 if not _name.startswith("__"):117 setattr(_locals[_name], "__module__", "httpx") # noqa112__locals = locals()113for __name in __all__:114 if not __name.startswith("__"):115 setattr(__locals[__name], "__module__", "httpx") # noqa
added:tests/test_exported_members.py+14 added
1import httpx2from httpx import __all__ as exported_members345def test_all_imports_are_exported() -> None:6 included_private_members = ["__description__", "__title__", "__version__"]7 assert exported_members == sorted(8 (9 member10 for member in vars(httpx).keys()11 if not member.startswith("_") or member in included_private_members12 ),13 key=str.casefold,14 )