From 0ef400195bde4716a758049e16cadab2dec19c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Mickevi=C4=8Dius?= Date: Tue, 5 May 2020 18:09:16 +0300 Subject: [PATCH] Fix linter --- tests/integration/test_httpx.py | 12 +++++------- tox.ini | 8 ++++---- vcr/stubs/httpx_stubs.py | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/integration/test_httpx.py b/tests/integration/test_httpx.py index cad73189..1d4eb9cd 100644 --- a/tests/integration/test_httpx.py +++ b/tests/integration/test_httpx.py @@ -1,4 +1,3 @@ -from unittest.mock import MagicMock import pytest import contextlib import os @@ -194,6 +193,7 @@ def test_behind_proxy(do_request): def test_cookies(tmpdir, scheme, do_request): def client_cookies(client): return [c for c in client._client.cookies] + def response_cookies(response): return [c for c in response.cookies] @@ -204,25 +204,24 @@ def response_cookies(response): testfile = str(tmpdir.join("cookies.yml")) with vcr.use_cassette(testfile): r1 = client("GET", url + "/cookies/set?k1=v1&k2=v2") - assert response_cookies(r1.history[0]) == ['k1', 'k2'] + assert response_cookies(r1.history[0]) == ["k1", "k2"] assert response_cookies(r1) == [] r2 = client("GET", url + "/cookies") assert len(r2.json()["cookies"]) == 2 - assert client_cookies(client) == ['k1', 'k2'] - + assert client_cookies(client) == ["k1", "k2"] new_client = do_request() assert client_cookies(new_client) == [] with vcr.use_cassette(testfile) as cassette: cassette_response = new_client("GET", url + "/cookies/set?k1=v1&k2=v2") - assert response_cookies(cassette_response.history[0]) == ['k1', 'k2'] + assert response_cookies(cassette_response.history[0]) == ["k1", "k2"] assert response_cookies(cassette_response) == [] assert cassette.play_count == 2 - assert client_cookies(new_client) == ['k1', 'k2'] + assert client_cookies(new_client) == ["k1", "k2"] def test_relative_redirects(tmpdir, scheme, do_request): @@ -239,4 +238,3 @@ def test_relative_redirects(tmpdir, scheme, do_request): assert response.json()["url"].endswith("get") assert cassette.play_count == 3 - diff --git a/tox.ini b/tox.ini index 055c13e4..def257ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skip_missing_interpreters=true -envlist = +envlist = cov-clean, lint, {py35,py36,py37,py38}-{requests,httplib2,urllib3,tornado4,boto3,aiohttp,httpx}, @@ -18,7 +18,7 @@ commands = coverage erase [testenv:cov-report] deps = coverage skip_install=true -commands = +commands = coverage html coverage report --fail-under=90 @@ -30,8 +30,8 @@ commands = flake8 --version flake8 --exclude=./docs/conf.py,./.tox/ pyflakes ./docs/conf.py -deps = - flake8 +deps = + flake8 black [testenv:docs] diff --git a/vcr/stubs/httpx_stubs.py b/vcr/stubs/httpx_stubs.py index b2d662b4..68ee38ed 100644 --- a/vcr/stubs/httpx_stubs.py +++ b/vcr/stubs/httpx_stubs.py @@ -2,7 +2,6 @@ import logging from unittest.mock import patch, MagicMock -from yarl import URL import httpx from vcr.request import Request as VcrRequest from vcr.errors import CannotOverwriteExistingCassetteException