From: Can Sarıgöl Date: Tue, 13 Aug 2019 14:22:18 +0000 (+0300) Subject: Add flake8-comprehensions to nox check task (#200) X-Git-Tag: 0.7.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b82d6373b6f8575a7fa3a6f5d18a8351fbb96bf;p=thirdparty%2Fhttpx.git Add flake8-comprehensions to nox check task (#200) * fixed as flake8-comprehensions * added site folder into gitignore --- diff --git a/.gitignore b/.gitignore index 90690006..fcadefce 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .mypy_cache/ __pycache__/ htmlcov/ +site/ *.egg-info/ venv/ .nox diff --git a/httpx/client.py b/httpx/client.py index 6b49797e..9d704b33 100644 --- a/httpx/client.py +++ b/httpx/client.py @@ -207,7 +207,7 @@ class BaseClient: # will raise redirect errors if appropriate. if len(history) > self.max_redirects: raise TooManyRedirects(response=history[-1]) - if request.url in [response.url for response in history]: + if request.url in (response.url for response in history): raise RedirectLoop(response=history[-1]) response = await self.dispatch.send( diff --git a/noxfile.py b/noxfile.py index a63d620c..d7246a90 100644 --- a/noxfile.py +++ b/noxfile.py @@ -28,7 +28,9 @@ def lint(session): @nox.session(reuse_venv=True) def check(session): - session.install("black", "flake8", "flake8-bugbear", "mypy") + session.install( + "black", "flake8", "flake8-bugbear", "flake8-comprehensions", "mypy" + ) session.run("black", "--check", "--target-version=py36", *source_files) session.run(