E303 Too many blank lines
MODIFY
test/test_connectionpool.py
test/test_connectionpool.py
@@ -193,7 +193,6 @@ class TestConnectionPool(unittest.TestCase):
"Max retries exceeded with url: Test. "
"(Caused by %r)" % err)
-
def test_pool_size(self):
POOL_SIZE = 1
pool = HTTPConnectionPool(host='localhost', maxsize=POOL_SIZE, block=True)

MODIFY
test/test_exceptions.py
test/test_exceptions.py
@@ -8,7 +8,6 @@ from urllib3.exceptions import (HTTPError, MaxRetryError, LocationParseError,
from urllib3.connectionpool import HTTPConnectionPool
-
class TestPickle(unittest.TestCase):
def verify_pickling(self, item):

MODIFY
test/test_filepost.py
test/test_filepost.py
@@ -39,7 +39,6 @@ class TestMultipartEncoding(unittest.TestCase):
encoded, _ = encode_multipart_formdata(fields, boundary=BOUNDARY)
self.assertEqual(encoded.count(b(BOUNDARY)), 3)
-
def test_field_encoding(self):
fieldsets = [
[('k', 'v'), ('k2', 'v2')],
@@ -65,7 +64,6 @@ class TestMultipartEncoding(unittest.TestCase):
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
-
def test_filename(self):
fields = [('k', ('somename', b'v'))]
@@ -83,7 +81,6 @@ class TestMultipartEncoding(unittest.TestCase):
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
-
def test_textplain(self):
fields = [('k', ('somefile.txt', b'v'))]
@@ -101,7 +98,6 @@ class TestMultipartEncoding(unittest.TestCase):
self.assertEqual(content_type,
'multipart/form-data; boundary=' + str(BOUNDARY))
-
def test_explicit(self):
fields = [('k', ('somefile.txt', b'v', 'image/jpeg'))]

MODIFY
test/test_poolmanager.py
test/test_poolmanager.py
@@ -75,7 +75,6 @@ class TestPoolManager(unittest.TestCase):
self.assertEqual(len(p.pools), 0)
-
def test_nohost(self):
p = PoolManager(5)
self.assertRaises(LocationValueError, p.connection_from_url, 'http://@')

MODIFY
test/test_response.py
test/test_response.py
@@ -119,7 +119,6 @@ class TestResponse(unittest.TestCase):
self.assertEqual(r.read(), b'')
self.assertEqual(r.read(), b'')
-
def test_chunked_decoding_deflate2(self):
import zlib
compress = zlib.compressobj(6, zlib.DEFLATED, -zlib.MAX_WBITS)
@@ -136,7 +135,6 @@ class TestResponse(unittest.TestCase):
self.assertEqual(r.read(), b'')
self.assertEqual(r.read(), b'')
-
def test_chunked_decoding_gzip(self):
import zlib
compress = zlib.compressobj(6, zlib.DEFLATED, 16 + zlib.MAX_WBITS)
@@ -153,7 +151,6 @@ class TestResponse(unittest.TestCase):
self.assertEqual(r.read(), b'')
self.assertEqual(r.read(), b'')
-
def test_body_blob(self):
resp = HTTPResponse(b'foo')
self.assertEqual(resp.data, b'foo')
@@ -233,7 +230,6 @@ class TestResponse(unittest.TestCase):
# versions. Probably this is because the `io` module in py2.6 is an
# old version that has a different underlying implementation.
-
fp = BytesIO(b'foo')
resp = HTTPResponse(fp, preload_content=False)

MODIFY
test/test_util.py
test/test_util.py
@@ -371,7 +371,6 @@ class TestUtil(unittest.TestCase):
except ValueError as e:
self.assertTrue('int, float or None' in str(e))
-
@patch('urllib3.util.timeout.current_time')
def test_timeout(self, current_time):
timeout = Timeout(total=3)
@@ -411,14 +410,12 @@ class TestUtil(unittest.TestCase):
timeout = Timeout(5)
self.assertEqual(timeout.total, 5)
-
def test_timeout_str(self):
timeout = Timeout(connect=1, read=2, total=3)
self.assertEqual(str(timeout), "Timeout(connect=1, read=2, total=3)")
timeout = Timeout(connect=1, read=None, total=3)
self.assertEqual(str(timeout), "Timeout(connect=1, read=None, total=3)")
-
@patch('urllib3.util.timeout.current_time')
def test_timeout_elapsed(self, current_time):
current_time.return_value = TIMEOUT_EPOCH

MODIFY
test/with_dummyserver/test_https.py
test/with_dummyserver/test_https.py
@@ -52,7 +52,6 @@ log.setLevel(logging.NOTSET)
log.addHandler(logging.StreamHandler(sys.stdout))
-
class TestHTTPS(HTTPSDummyServerTestCase):
def setUp(self):
self._pool = HTTPSConnectionPool(self.host, self.port)

MODIFY
test/with_dummyserver/test_proxy_poolmanager.py
test/with_dummyserver/test_proxy_poolmanager.py
@@ -279,7 +279,6 @@ class TestHTTPProxyManager(HTTPDummyProxyTestCase):
self.assertNotEqual(sc2,sc3)
self.assertEqual(sc3,sc4)
-
@timed(0.5)
@requires_network
def test_https_proxy_timeout(self):
@@ -290,7 +289,6 @@ class TestHTTPProxyManager(HTTPDummyProxyTestCase):
except MaxRetryError as e:
self.assertEqual(type(e.reason), ConnectTimeoutError)
-
@timed(0.5)
@requires_network
def test_https_proxy_pool_timeout(self):

E303 Too many blank lines