From 1b82d6373b6f8575a7fa3a6f5d18a8351fbb96bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20Sar=C4=B1g=C3=B6l?= Date: Tue, 13 Aug 2019 17:22:18 +0300 Subject: [PATCH] Add flake8-comprehensions to nox check task (#200) * fixed as flake8-comprehensions * added site folder into gitignore --- .gitignore | 1 + httpx/client.py | 2 +- noxfile.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) 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(