diff --git a/httpie/cli/constants.py b/httpie/cli/constants.py index 5b1d5986..e0690e02 100644 --- a/httpie/cli/constants.py +++ b/httpie/cli/constants.py @@ -5,15 +5,6 @@ import enum import re -# TODO: Use MultiDict for headers once added to `requests`. -# - - -# ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) -# -from enum import Enum - - URL_SCHEME_RE = re.compile(r'^[a-z][a-z0-9.+-]*://', re.IGNORECASE) HTTP_POST = 'POST' diff --git a/httpie/cli/requestitems.py b/httpie/cli/requestitems.py index 3168c39c..e75e0395 100644 --- a/httpie/cli/requestitems.py +++ b/httpie/cli/requestitems.py @@ -1,5 +1,4 @@ import os -from io import BytesIO from typing import Callable, Dict, IO, List, Optional, Tuple, Union from httpie.cli.argtypes import KeyValueArg diff --git a/httpie/core.py b/httpie/core.py index 5092c5ea..43b4255c 100644 --- a/httpie/core.py +++ b/httpie/core.py @@ -283,6 +283,6 @@ def decode_raw_args( """ return [ arg.decode(stdin_encoding) - if type(arg) == bytes else arg + if type(arg) is bytes else arg for arg in args ] diff --git a/setup.py b/setup.py index a10fd8d7..5204cadf 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ class PyTest(TestCommand): and runs the tests with no fancy stuff like parallel execution. """ + def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [ diff --git a/tests/test_downloads.py b/tests/test_downloads.py index 381bd030..f32043b8 100644 --- a/tests/test_downloads.py +++ b/tests/test_downloads.py @@ -5,7 +5,6 @@ from urllib.request import urlopen import pytest import mock -import requests from requests.structures import CaseInsensitiveDict from httpie.downloads import ( diff --git a/tests/test_httpie.py b/tests/test_httpie.py index 877d5c84..5a297071 100644 --- a/tests/test_httpie.py +++ b/tests/test_httpie.py @@ -182,4 +182,4 @@ def test_json_input_preserve_order(httpbin_both): 'order:={"map":{"1":"first","2":"second"}}') assert HTTP_OK in r assert r.json['data'] == \ - '{"order": {"map": {"1": "first", "2": "second"}}}' + '{"order": {"map": {"1": "first", "2": "second"}}}'