============================= test session starts ==============================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
rootdir: /build/python-httpx/src/httpx-0.21.3, configfile: setup.cfg
plugins: trio-0.7.0, anyio-3.5.0, asyncio-0.16.0
collected 672 items

tests/test_api.py ...........                                            [  1%]
tests/test_asgi.py ....................                                  [  4%]
tests/test_auth.py ...                                                   [  5%]
tests/test_config.py ...............................                     [  9%]
tests/test_content.py .....................                              [ 12%]
tests/test_decoders.py ..............................                    [ 17%]
tests/test_exceptions.py ....                                            [ 17%]
tests/test_exported_members.py .                                         [ 18%]
tests/test_main.py .FFFFFFF..                                            [ 19%]
tests/test_multipart.py .......................                          [ 22%]
tests/test_status_codes.py ......                                        [ 23%]
tests/test_timeouts.py ........                                          [ 25%]
tests/test_utils.py ................................................     [ 32%]
tests/test_wsgi.py ...........                                           [ 33%]
tests/client/test_async_client.py ...................................... [ 39%]
..............                                                           [ 41%]
tests/client/test_auth.py ...........................................    [ 47%]
tests/client/test_client.py .................................            [ 52%]
tests/client/test_cookies.py .......                                     [ 53%]
tests/client/test_event_hooks.py .........                               [ 55%]
tests/client/test_headers.py .........                                   [ 56%]
tests/client/test_properties.py .......                                  [ 57%]
tests/client/test_proxies.py ........................................... [ 63%]
..............................                                           [ 68%]
tests/client/test_queryparams.py ...                                     [ 68%]
tests/client/test_redirects.py .............................             [ 73%]
tests/models/test_cookies.py .......                                     [ 74%]
tests/models/test_headers.py ..................                          [ 76%]
tests/models/test_queryparams.py .............                           [ 78%]
tests/models/test_requests.py .....................                      [ 81%]
tests/models/test_responses.py ......................................... [ 88%]
...........................................                              [ 94%]
tests/models/test_url.py .....................................           [100%]

=================================== FAILURES ===================================
___________________________________ test_get ___________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_get(server):
        url = str(server.url)
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url])
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: text/plain",
            "transfer-encoding: chunked",
            "",
            "Hello, world!",
        ]
E       AssertionError: assert ['HTTP/1.1 20...ello, world!'] == ['HTTP/1.1 20...ello, world!']
E         At index 3 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:28: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36170 - "GET / HTTP/1.1" 200 OK
__________________________________ test_json ___________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_json(server):
        url = str(server.url.copy_with(path="/json"))
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url])
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: application/json",
            "transfer-encoding: chunked",
            "",
            "{",
            '"Hello": "world!"',
            "}",
        ]
E       AssertionError: assert ['HTTP/1.1 20... '', '{', ...] == ['HTTP/1.1 20... '', '{', ...]
E         At index 3 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:43: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36174 - "GET /json HTTP/1.1" 200 OK
________________________________ test_redirects ________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_redirects(server):
        url = str(server.url.copy_with(path="/redirect_301"))
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url])
        assert result.exit_code == 1
>       assert remove_date_header(splitlines(result.output)) == [
            "HTTP/1.1 301 Moved Permanently",
            "server: uvicorn",
            "location: /",
            "transfer-encoding: chunked",
            "",
        ]
E       AssertionError: assert ['HTTP/1.1 30... chunked', ''] == ['HTTP/1.1 30... chunked', '']
E         At index 3 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:60: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36176 - "GET /redirect_301 HTTP/1.1" 301 Moved Permanently
____________________________ test_follow_redirects _____________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_follow_redirects(server):
        url = str(server.url.copy_with(path="/redirect_301"))
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url, "--follow-redirects"])
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "HTTP/1.1 301 Moved Permanently",
            "server: uvicorn",
            "location: /",
            "transfer-encoding: chunked",
            "",
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: text/plain",
            "transfer-encoding: chunked",
            "",
            "Hello, world!",
        ]
E       AssertionError: assert ['HTTP/1.1 30... 200 OK', ...] == ['HTTP/1.1 30... 200 OK', ...]
E         At index 3 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:74: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36178 - "GET /redirect_301 HTTP/1.1" 301 Moved Permanently
INFO:     127.0.0.1:36178 - "GET / HTTP/1.1" 200 OK
__________________________________ test_post ___________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_post(server):
        url = str(server.url.copy_with(path="/echo_body"))
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url, "-m", "POST", "-j", '{"hello": "world"}'])
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: text/plain",
            "transfer-encoding: chunked",
            "",
            '{"hello": "world"}',
        ]
E       assert ['HTTP/1.1 20...o": "world"}'] == ['HTTP/1.1 20...o": "world"}']
E         At index 3 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:94: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36182 - "POST /echo_body HTTP/1.1" 200 OK
_________________________________ test_verbose _________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_verbose(server):
        url = str(server.url)
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url, "-v"])
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "* Connecting to '127.0.0.1'",
            "* Connected to '127.0.0.1' on port 8000",
            "GET / HTTP/1.1",
            f"Host: {server.url.netloc.decode('ascii')}",
            "Accept: */*",
            "Accept-Encoding: gzip, deflate, br",
            "Connection: keep-alive",
            f"User-Agent: python-httpx/{httpx.__version__}",
            "",
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: text/plain",
            "transfer-encoding: chunked",
            "",
            "Hello, world!",
        ]
E       assert ["* Connectin...ate, br', ...] == ["* Connectin...ate, br', ...]
E         At index 12 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:109: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36184 - "GET / HTTP/1.1" 200 OK
__________________________________ test_auth ___________________________________

server = <tests.conftest.TestServer object at 0x40049ca830>

    def test_auth(server):
        url = str(server.url)
        runner = CliRunner()
        result = runner.invoke(httpx.main, [url, "-v", "--auth", "username", "password"])
        print(result.output)
        assert result.exit_code == 0
>       assert remove_date_header(splitlines(result.output)) == [
            "* Connecting to '127.0.0.1'",
            "* Connected to '127.0.0.1' on port 8000",
            "GET / HTTP/1.1",
            f"Host: {server.url.netloc.decode('ascii')}",
            "Accept: */*",
            "Accept-Encoding: gzip, deflate, br",
            "Connection: keep-alive",
            f"User-Agent: python-httpx/{httpx.__version__}",
            "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
            "",
            "HTTP/1.1 200 OK",
            "server: uvicorn",
            "content-type: text/plain",
            "transfer-encoding: chunked",
            "",
            "Hello, world!",
        ]
E       assert ["* Connectin...ate, br', ...] == ["* Connectin...ate, br', ...]
E         At index 13 diff: 'Transfer-Encoding: chunked' != 'transfer-encoding: chunked'
E         Use -v to get the full diff

tests/test_main.py:134: AssertionError
----------------------------- Captured stdout call -----------------------------
INFO:     127.0.0.1:36186 - "GET / HTTP/1.1" 200 OK
* Connecting to '127.0.0.1'
* Connected to '127.0.0.1' on port 8000
GET / HTTP/1.1
Host: 127.0.0.1:8000
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
User-Agent: python-httpx/0.21.3
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

HTTP/1.1 200 OK
date: Mon, 17 Jan 2022 09:31:11 GMT
server: uvicorn
content-type: text/plain
Transfer-Encoding: chunked

Hello, world!

======================== 7 failed, 665 passed in 31.89s ========================
[1m[31m==> ERROR:[m[1m A failure occurred in check().[m
[1m    Aborting...[m
