* Switch event hooks to also run on redirects
* Bump coverage
* Add pragma: no cover, because sometime ya just gotta be pragmatic
* Update docs with note about response.read()
* Add a network pytest mark for tests that use the network
Sometimes it's useful to have the tests that use the network
marked so they can be skipped easily when we know the network
is not available.
This is useful for example on SUSE and openSUSE's build servers.
When building the httpx packages (actually, any package in the
distribution) the network is disabled so we can assure
reproducible builds (among other benefits). With this mark, it's
easier to skip tests that can not succeed.
* Add a better explanation for the network marker
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Use either brotli (recommended for CPython) or brotlicffi (Recommended for PyPy and others)
* Add comments in places where we switch behaviour depending on brotli/brotlicffi
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Fix test_json_without_specified_encoding_*_error tests on big endian
platforms. The tests wrongly assume that data encoded as "utf-32-be"
can not be decoded as "utf-32". This is true on little endian platforms
but on big endian platforms "utf-32" is equivalent to "utf-32-be".
To avoid the problem, explicitly decode as "utf-32-le", as this should
trigger the expected exception independently of platform's endianness.
* Treat warnings as errors
* Defensive programming in Client.__del__ to avoid possible warnings on partially initialized instances
* Linting
* Ignore linting getattr errors in __del__
* getattr requires a default
* Tighten up closing of auth_flow generators
* Switch multipart test to open file in a context manager
* Ignore warnings on uvicorn
* Drop -Werror from addopts
* Warings specified entirely in 'filterwarnings' section
* Use ssl.PROTOCOL_TLS_CLIENT instead of deprecated ssl.PROTOCOL_TLS
* Push 'check_hostname = False' above 'context.verify_mode = ssl.CERT_NONE'
* Introduce set_minimum_tls_version_1_2 compatible across different python versions
* Commenting
* Add missing annotation
* Exclude _compat from coverage
Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: jianghang <jianghang@didiglobal.com>
* Adding netrc environment variable documentation
* Update docs/environment_variables.md
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Modifications about netrcfile environment variable
* Change uppercase "A" in netrcfile env variable into lowercase
* Added some words and a dot before "my_netrc" in the console example
* changed a typo "rather that" into "rather than" in advanced.md
* changed netrc environment variable in example part
* modified title for netrc environment variable part in doc
* Deleted the dot in title of netrc environment variable
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Pass flag http1 to httpcore.
* Update httpcore version, reorder parameter list
Co-authored-by: ebertli <bert.lindemann@ericsson.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Add failing test case for 'content=io.BytesIO(...)'
* Refactor peek_filelike_length to return an Optional[int]
* Peek filelength on file-like objects when rendering 'content=...'
* Switch to USE_CLIENT_DEFAULT
* Switch to USE_CLIENT_DEFAULT
* Linting
* Add failing test case for 'content=io.BytesIO(...)'
* Refactor peek_filelike_length to return an Optional[int]
* Peek filelength on file-like objects when rendering 'content=...'
* Support HTTPCore 0.13
* Update httpcore minimum version
* Call into 'handle_async_request', not 'arequest'
* Drop unintentional commit
* Update tests
* Make Request and Response picklable
* fixup! Make Request and Response picklable
* Apply suggestions from code review
* Apply suggestions from code review
* Update tests/models/test_requests.py
Co-authored-by: Tom Christie <tom@tomchristie.com>