* fix type annotation for MockTransport
* add type ignore
* better type checks
* better type checks
* add pragma
---------
Co-authored-by: Tom Christie <tom@tomchristie.com>
* replace pytest-asyncio with anyio
* remove pytest-trio also
* Update setup.cfg
* use anyio.Lock in test_auth
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Typing: enable disallow_untyped_calls
Only the test suite needed adjusting to add type hints.
* Update setup.cfg
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Switch default on allow_redirects to False
* allow_redirects -> follow_redirects
* Update follow_redirects default in top-level API
* Update docs on follow_redirects
* Added httpx.BaseTransport and httpx.AsyncBaseTransport
* Test coverage and default transports to calling .close on __exit__
* BaseTransport documentation
* Use 'handle_request' for the transport API.
* Docs tweaks
* Docs tweaks
* Minor docstring tweak
* Transport API docs
* Drop 'Optional' on Transport API
* Docs tweaks
* Tweak CHANGELOG
* Drop erronous example.py
* Push httpcore exception wrapping out of client into transport (#1524)
* Push httpcore exception wrapping out of client into transport
* Include close/aclose extensions in docstring
* Comment about the request property on RequestError exceptions
* Extensions reason_phrase and http_version as bytes (#1526)
* Extensions reason_phrase and http_version as bytes
* Update BaseTransport docstring
* Neaten up our try...except structure for ensuring responses (#1525)
* Fix CHANGELOG typo
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Fix CHANGELOG typo
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* stream: Iterator[bytes] -> stream: Iterable[bytes]
* Use proper bytestream interfaces when calling into httpcore
* Grungy typing workaround due to httpcore using Iterator instead of Iterable in bytestream types
* Update docs/advanced.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Consistent typing imports across tranports
* Update docs/advanced.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Add httpx.MockTransport
* Add docs on MockTransport
* Add pointer to RESPX
* Add note on pytest-httpx
* Tweak existing docs example to use 'httpx.MockTransport'
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Prefer httpx.Client over httpx.AsyncClient in test cases, unless required.
* Prefer httpx.Client in test_headers
* Consistent httpx imports and httpx.Client usage
* Use 'import httpx' consistently in tests. Prefer httpx.Client.
* Keep HTTPError as a base class for .request() and .raise_for_status()
* Updates for httpcore 0.10
* Update httpx/_exceptions.py
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* Use httpcore.SimpleByteStream/httpcore.IteratorByteStream
* Use httpcore.PlainByteStream
* Merge master
* Update to httpcore 0.10.x
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* Fix HttpError -> HTTPError typo
* Increased test coverage
* Increase coverage threshold
* Reuse sync/async transport code in test_auth.py
* Removed close_client check inside StreamContextManager
It's never set as True when used in async
* Reuse sync/async transport code in test_redirects.py
* First pass as switching dispatchers over to httpcore interface
* Updates for httpcore interface
* headers in dispatch API as plain list of bytes
* Integrate against httpcore 0.6
* Integrate against httpcore interface
* Drop UDS, since not supported by httpcore
* Fix base class for mock dispatchers in tests
* Merge master and mark as potential '0.13.dev0' release
* Bump coverage
* Tests for iterative text decoding with 'aiter_text'
* nocover on xfail exception cases
* nocover API that is pending deprecation
* Tweak test to removed uncovered line
* Ingest request body in RedirectBodyUnavailable test case
* Refactor tests in the light of backend auto-detection
* Test passing explicit backend separately
* Drop 'backend=backend'
* Fix usage of asyncio.run() on 3.6