Skip to content
Myr

Add flake8-pie plugin (#419)

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

authored by Stephen Brown II · committed by Seth Michael Larson · parent 7f76a64 · Browse files · 4 files+15 added−10 removed
This commit

State

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

Diff stats

4 files+15 added−10 removed

  • tests:+5 added−5 removed
  • other:+10 added−5 removed

4 files+15 added−10 removed

modified:httpx/client.py+2 added-4 removed
323 unmodified lines
324 url = self.merge_url(url)325 headers = self.merge_headers(headers)326 cookies = self.merge_cookies(cookies)327 params = self.merge_queryparams(params)328 request = AsyncRequest(328 return AsyncRequest(329 method,330 url,331 data=data,332 files=files,
1 unmodified line
334 params=params,335 headers=headers,336 cookies=cookies,337 )338 return request338339340class AsyncClient(BaseClient):341 async def get(
374 unmodified lines
716 params=params,717 headers=headers,718 cookies=cookies,719 )721 response = self.send(720 return self.send(721 request,722 stream=stream,723 auth=auth,724 allow_redirects=allow_redirects,
1 unmodified line
726 cert=cert,727 timeout=timeout,728 trust_env=trust_env,729 )731 return response730731 def send(732 self,733 request: AsyncRequest,
335 unmodified lines
modified:tests/dispatch/test_proxy_http.py+5 added-5 removed
24 unmodified lines
25 proxy_url="http://127.0.0.1:8000",26 backend=raw_io,27 proxy_mode=httpx.HTTPProxyMode.TUNNEL_ONLY,28 ) as proxy:29 response = await proxy.request("GET", f"http://example.com")29 response = await proxy.request("GET", "http://example.com")3031 assert response.status_code == 40432 assert response.headers["Server"] == "origin-server"33
29 unmodified lines
63 proxy_url="http://127.0.0.1:8000",64 backend=raw_io,65 proxy_mode=httpx.HTTPProxyMode.TUNNEL_ONLY,66 ) as proxy:67 await proxy.request("GET", f"http://example.com")67 await proxy.request("GET", "http://example.com")6869 # ProxyError.request should be the CONNECT request not the original request70 assert e.value.request.method == "CONNECT"71 assert e.value.request.headers["Host"] == "127.0.0.1:8000"
43 unmodified lines
115 proxy_url="http://127.0.0.1:8000",116 backend=raw_io,117 proxy_mode=httpx.HTTPProxyMode.TUNNEL_ONLY,118 ) as proxy:119 resp = await proxy.request("GET", f"https://example.com")119 resp = await proxy.request("GET", "https://example.com")120121 assert resp.status_code == 404122 assert resp.headers["Server"] == "origin-server"123
3 unmodified lines
127128 await resp.read()129130 # Make another request to see that the tunnel is re-used.131 resp = await proxy.request("GET", f"https://example.com/target")131 resp = await proxy.request("GET", "https://example.com/target")132133 assert resp.status_code == 200134 assert resp.headers["Server"] == "origin-server"135
35 unmodified lines
171 proxy_mode=proxy_mode,172 proxy_headers={"Proxy-Authorization": "test", "Override": "2"},173 ) as proxy:174 response = await proxy.request(175 "GET", f"http://example.com", headers={"override": "1"}175 "GET", "http://example.com", headers={"override": "1"}176 )177178 assert response.status_code == 200179 assert response.headers["Server"] == "origin-server"
35 unmodified lines
modified:noxfile.py+7 added-1 removed
18 unmodified lines
1920@nox.session(reuse_venv=True)21def check(session):22 session.install(23 "black", "flake8", "flake8-bugbear", "flake8-comprehensions", "isort", "mypy"23 "black",24 "flake8",25 "flake8-bugbear",26 "flake8-comprehensions",27 "flake8-pie",28 "isort",29 "mypy",30 )3132 session.run("black", "--check", "--diff", "--target-version=py36", *source_files)33 session.run("flake8", *source_files)
17 unmodified lines
modified:test-requirements.txt+1 added
5 unmodified lines
6cryptography7flake88flake8-bugbear9flake8-comprehensions10flake8-pie11isort12mypy13pytest14pytest-asyncio
8 unmodified lines