various pep-8 cleanups; remove unsused imports; remove unused variables
diff --git a/test_requests.py b/test_requests.py
index 0866fccbb3..283353b919 100755
--- a/test_requests.py
+++ b/test_requests.py
@@ -19,10 +19,10 @@
     Morsel, cookielib, getproxies, str, urljoin, urlparse, is_py3, builtin_str)
 from requests.cookies import cookiejar_from_dict, morsel_to_cookie
 from requests.exceptions import InvalidURL, MissingSchema
-from requests.models import PreparedRequest, Response
+from requests.models import PreparedRequest
 from requests.structures import CaseInsensitiveDict
 from requests.sessions import SessionRedirectMixin
-from requests.models import PreparedRequest, urlencode
+from requests.models import urlencode
 from requests.hooks import default_hooks
 
 try:
@@ -153,7 +153,7 @@ def test_HTTP_200_OK_GET_WITH_MIXED_PARAMS(self):
     def test_set_cookie_on_301(self):
         s = requests.session()
         url = httpbin('cookies/set?foo=bar')
-        r = s.get(url)
+        s.get(url)
         assert s.cookies['foo'] == 'bar'
 
     def test_cookie_sent_on_redirect(self):
@@ -213,7 +213,7 @@ def test_generic_cookiejar_works(self):
 
     def test_param_cookiejar_works(self):
         cj = cookielib.CookieJar()
-        cookiejar_from_dict({'foo' : 'bar'}, cj)
+        cookiejar_from_dict({'foo': 'bar'}, cj)
         s = requests.session()
         r = s.get(httpbin('cookies'), cookies=cj)
         # Make sure the cookie was sent
@@ -393,7 +393,7 @@ def test_POSTBIN_GET_POST_FILES(self):
         assert post4.status_code == 200
 
         with pytest.raises(ValueError):
-            requests.post(url, files = ['bad file data'])
+            requests.post(url, files=['bad file data'])
 
     def test_POSTBIN_GET_POST_FILES_WITH_DATA(self):
 
@@ -404,14 +404,15 @@ def test_POSTBIN_GET_POST_FILES_WITH_DATA(self):
         assert post1.status_code == 200
 
         with open('requirements.txt') as f:
-            post2 = requests.post(url, data={'some': 'data'}, files={'some': f})
+            post2 = requests.post(url,
+                data={'some': 'data'}, files={'some': f})
         assert post2.status_code == 200
 
         post4 = requests.post(url, data='[{"some": "json"}]')
         assert post4.status_code == 200
 
         with pytest.raises(ValueError):
-            requests.post(url, files = ['bad file data'])
+            requests.post(url, files=['bad file data'])
 
     def test_conflicting_post_params(self):
         url = httpbin('post')
@@ -444,7 +445,10 @@ def test_unicode_get(self):
         requests.get(httpbin('ø'), params={'foo': 'foo'})
 
     def test_unicode_header_name(self):
-        requests.put(httpbin('put'), headers={str('Content-Type'): 'application/octet-stream'}, data='\xff') # compat.str is unicode.
+        requests.put(
+            httpbin('put'),
+            headers={str('Content-Type'): 'application/octet-stream'},
+            data='\xff')  # compat.str is unicode.
 
     def test_pyopenssl_redirect(self):
         requests.get('https://httpbin.org/status/301')
@@ -457,30 +461,30 @@ def test_urlencoded_get_query_multivalued_param(self):
 
     def test_different_encodings_dont_break_post(self):
         r = requests.post(httpbin('post'),
-                          data={'stuff': json.dumps({'a': 123})},
-                          params={'blah': 'asdf1234'},
-                          files={'file': ('test_requests.py', open(__file__, 'rb'))})
+            data={'stuff': json.dumps({'a': 123})},
+            params={'blah': 'asdf1234'},
+            files={'file': ('test_requests.py', open(__file__, 'rb'))})
         assert r.status_code == 200
 
     def test_unicode_multipart_post(self):
         r = requests.post(httpbin('post'),
-                          data={'stuff': u('ëlïxr')},
-                          files={'file': ('test_requests.py', open(__file__, 'rb'))})
+            data={'stuff': u('ëlïxr')},
+            files={'file': ('test_requests.py', open(__file__, 'rb'))})
         assert r.status_code == 200
 
         r = requests.post(httpbin('post'),
-                          data={'stuff': u('ëlïxr').encode('utf-8')},
-                          files={'file': ('test_requests.py', open(__file__, 'rb'))})
+            data={'stuff': u('ëlïxr').encode('utf-8')},
+            files={'file': ('test_requests.py', open(__file__, 'rb'))})
         assert r.status_code == 200
 
         r = requests.post(httpbin('post'),
-                          data={'stuff': 'elixr'},
-                          files={'file': ('test_requests.py', open(__file__, 'rb'))})
+            data={'stuff': 'elixr'},
+            files={'file': ('test_requests.py', open(__file__, 'rb'))})
         assert r.status_code == 200
 
         r = requests.post(httpbin('post'),
-                          data={'stuff': 'elixr'.encode('utf-8')},
-                          files={'file': ('test_requests.py', open(__file__, 'rb'))})
+            data={'stuff': 'elixr'.encode('utf-8')},
+            files={'file': ('test_requests.py', open(__file__, 'rb'))})
         assert r.status_code == 200
 
     def test_unicode_multipart_post_fieldnames(self):
@@ -496,15 +500,17 @@ def test_unicode_multipart_post_fieldnames(self):
 
     def test_unicode_method_name(self):
         files = {'file': open('test_requests.py', 'rb')}
-        r = requests.request(method=u('POST'), url=httpbin('post'), files=files)
+        r = requests.request(
+            method=u('POST'), url=httpbin('post'), files=files)
         assert r.status_code == 200
 
     def test_custom_content_type(self):
-        r = requests.post(httpbin('post'),
-                          data={'stuff': json.dumps({'a': 123})},
-                          files={'file1': ('test_requests.py', open(__file__, 'rb')),
-                                 'file2': ('test_requests', open(__file__, 'rb'),
-                                           'text/py-content-type')})
+        r = requests.post(
+            httpbin('post'),
+            data={'stuff': json.dumps({'a': 123})},
+            files={'file1': ('test_requests.py', open(__file__, 'rb')),
+                   'file2': ('test_requests', open(__file__, 'rb'),
+                             'text/py-content-type')})
         assert r.status_code == 200
         assert b"text/py-content-type" in r.request.body
 
@@ -563,7 +569,8 @@ def __call__(self, r):
         prep = s.prepare_request(req)
         resp = s.send(prep)
 
-        assert resp.json()['headers']['Dummy-Auth-Test'] == 'dummy-auth-test-ok'
+        assert resp.json()['headers'][
+            'Dummy-Auth-Test'] == 'dummy-auth-test-ok'
 
     def test_links(self):
         r = requests.Response()
@@ -694,7 +701,6 @@ def test_cookie_as_dict_items(self):
         # make sure one can use items multiple times
         assert list(items) == list(items)
 
-
     def test_time_elapsed_blank(self):
         r = requests.get(httpbin('get'))
         td = r.elapsed
@@ -862,7 +868,6 @@ def test_params_are_merged_case_sensitive(self):
         r = s.get(httpbin('get'), params={'FOO': 'bar'})
         assert r.json()['args'] == {'foo': 'bar', 'FOO': 'bar'}
 
-
     def test_long_authinfo_in_url(self):
         url = 'http://{0}:{1}@{2}:9000/path?query#frag'.format(
             'E8A3BE87-9E3F-4620-8858-95478E385B5B',
@@ -1017,7 +1022,7 @@ def test_precedence(self):
 class TestCaseInsensitiveDict(unittest.TestCase):
 
     def test_mapping_init(self):
-        cid = CaseInsensitiveDict({'Foo': 'foo','BAr': 'bar'})
+        cid = CaseInsensitiveDict({'Foo': 'foo', 'BAr': 'bar'})
         assert len(cid) == 2
         assert 'foo' in cid
         assert 'bar' in cid
@@ -1091,7 +1096,7 @@ def test_update(self):
         cid['spam'] = 'blueval'
         cid.update({'sPam': 'notblueval'})
         assert cid['spam'] == 'notblueval'
-        cid = CaseInsensitiveDict({'Foo': 'foo','BAr': 'bar'})
+        cid = CaseInsensitiveDict({'Foo': 'foo', 'BAr': 'bar'})
         cid.update({'fOO': 'anotherfoo', 'bAR': 'anotherbar'})
         assert len(cid) == 2
         assert cid['foo'] == 'anotherfoo'
@@ -1161,20 +1166,24 @@ def test_super_len_io_streams(self):
         from requests.utils import super_len
 
         assert super_len(StringIO.StringIO()) == 0
-        assert super_len(StringIO.StringIO('with so much drama in the LBC')) == 29
+        assert super_len(
+            StringIO.StringIO('with so much drama in the LBC')) == 29
 
         assert super_len(BytesIO()) == 0
-        assert super_len(BytesIO(b"it's kinda hard bein' snoop d-o-double-g")) == 40
+        assert super_len(
+            BytesIO(b"it's kinda hard bein' snoop d-o-double-g")) == 40
 
         try:
             import cStringIO
         except ImportError:
             pass
         else:
-            assert super_len(cStringIO.StringIO('but some how, some way...')) == 25
+            assert super_len(
+                cStringIO.StringIO('but some how, some way...')) == 25
 
     def test_get_environ_proxies_ip_ranges(self):
-        """ Ensures that IP addresses are correctly matches with ranges in no_proxy variable """
+        """Ensures that IP addresses are correctly matches with ranges
+        in no_proxy variable."""
         from requests.utils import get_environ_proxies
         os.environ['no_proxy'] = "192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1"
         assert get_environ_proxies('http://192.168.0.1:5000/') == {}
@@ -1185,10 +1194,12 @@ def test_get_environ_proxies_ip_ranges(self):
         assert get_environ_proxies('http://192.168.1.1/') != {}
 
     def test_get_environ_proxies(self):
-        """ Ensures that IP addresses are correctly matches with ranges in no_proxy variable """
+        """Ensures that IP addresses are correctly matches with ranges
+        in no_proxy variable."""
         from requests.utils import get_environ_proxies
         os.environ['no_proxy'] = "127.0.0.1,localhost.localdomain,192.168.0.0/24,172.16.1.1"
-        assert get_environ_proxies('http://localhost.localdomain:5000/v1.0/') == {}
+        assert get_environ_proxies(
+            'http://localhost.localdomain:5000/v1.0/') == {}
         assert get_environ_proxies('http://www.requests.com/') != {}
 
     def test_is_ipv4_address(self):
@@ -1214,12 +1225,15 @@ def test_address_in_network(self):
         assert not address_in_network('172.16.0.1', '192.168.1.0/24')
 
     def test_get_auth_from_url(self):
-        """ Ensures that username and password in well-encoded URI as per RFC 3986 are correclty extracted """
+        """Ensures that username and password in well-encoded URI as per
+        RFC 3986 are correclty extracted."""
         from requests.utils import get_auth_from_url
         from requests.compat import quote
         percent_encoding_test_chars = "%!*'();:@&=+$,/?#[] "
         url_address = "request.com/url.html#test"
-        url = "http://" + quote(percent_encoding_test_chars, '') + ':' + quote(percent_encoding_test_chars, '') + '@' + url_address
+        url = "http://" + quote(
+            percent_encoding_test_chars, '') + ':' + quote(
+            percent_encoding_test_chars, '') + '@' + url_address
         (username, password) = get_auth_from_url(url)
         assert username == percent_encoding_test_chars
         assert password == percent_encoding_test_chars
@@ -1286,7 +1300,7 @@ def test_max_age_invalid_str(self):
 class TestTimeout:
     def test_stream_timeout(self):
         try:
-            r = requests.get('https://httpbin.org/delay/10', timeout=5.0)
+            requests.get('https://httpbin.org/delay/10', timeout=5.0)
         except requests.exceptions.Timeout as e:
             assert 'Read timed out' in e.args[0].args[0]
 
@@ -1353,10 +1367,10 @@ def test_requests_are_updated_each_time(self):
 @pytest.fixture
 def list_of_tuples():
     return [
-            (('a', 'b'), ('c', 'd')),
-            (('c', 'd'), ('a', 'b')),
-            (('a', 'b'), ('c', 'd'), ('e', 'f')),
-            ]
+        (('a', 'b'), ('c', 'd')),
+        (('c', 'd'), ('a', 'b')),
+        (('a', 'b'), ('c', 'd'), ('e', 'f')),
+        ]
 
 
 def test_data_argument_accepts_tuples(list_of_tuples):
@@ -1374,14 +1388,17 @@ def test_data_argument_accepts_tuples(list_of_tuples):
         )
         assert p.body == urlencode(data)
 
+
 def assert_copy(p, p_copy):
     for attr in ('method', 'url', 'headers', '_cookies', 'body', 'hooks'):
         assert getattr(p, attr) == getattr(p_copy, attr)
 
+
 def test_prepared_request_empty_copy():
     p = PreparedRequest()
     assert_copy(p, p.copy())
 
+
 def test_prepared_request_no_cookies_copy():
     p = PreparedRequest()
     p.prepare(
@@ -1392,6 +1409,7 @@ def test_prepared_request_no_cookies_copy():
     )
     assert_copy(p, p.copy())
 
+
 def test_prepared_request_complete_copy():
     p = PreparedRequest()
     p.prepare(

A number of PEP-8 related cleanups. Also removing unused imports and unused variables.
