Commit 2240f483 authored by Jason Madden's avatar Jason Madden

PEP8 cleanup.

parent 955dbc61
[pep8]
ignore=E702,E265,E402,E731,E266,E261
ignore=E702,E265,E402,E731,E266,E261,W503
max_line_length=160
exclude=.tox,.git,build,2.6,2.7,2.7pypy,3.3,test_support.py,test_queue.py,patched_tests_setup.py,test_threading_2.py,lock_tests.py,_sslgte279.py
......@@ -398,6 +398,7 @@ else:
if hasattr(__socket__, 'ssl'):
from gevent.hub import PYGTE279
def ssl(sock, keyfile=None, certfile=None):
# deprecated in 2.7.9 but still present
if PYGTE279:
......
......@@ -127,6 +127,7 @@ class BaseServer(object):
def do_handle(self, *args):
spawn = self._spawn
handle = self._handle
def _close_when_done(*args):
try:
return handle(*args)
......
......@@ -1058,6 +1058,7 @@ class child(watcher):
def rstatus(self, value):
self._watcher.rstatus = value
class stat(watcher):
_watcher_start = libev.ev_stat_start
_watcher_stop = libev.ev_stat_stop
......@@ -1106,6 +1107,7 @@ class stat(watcher):
def interval(self):
return self._watcher.interval
def _syserr_cb(msg):
try:
msg = ffi.string(msg)
......
......@@ -41,7 +41,7 @@ if PYPY:
# otherwise we get a new DummyThread, which cannot be joined.
# Fixes tests in test_threading_2
if _get_ident() not in __threading__._active and len(__threading__._active) == 1:
k,v = __threading__._active.items()[0]
k, v = __threading__._active.items()[0]
del __threading__._active[k]
__threading__._active[_get_ident()] = v
......
......@@ -10,6 +10,7 @@ import util
import ssl
class Test_wsgiserver(util.TestServer):
server = 'wsgiserver.py'
URL = 'http://127.0.0.1:8088'
......
......@@ -10,7 +10,6 @@ except ImportError as ex:
sys.exit(0)
class TestPickle(greentest.TestCase):
# Issue 104: ares.ares_host_result unpickleable
......@@ -24,7 +23,7 @@ class TestPickle(greentest.TestCase):
for i in range(0, pickle.HIGHEST_PROTOCOL):
def make_test(j):
return lambda self: self._test(j)
setattr(TestPickle, 'test' + str(i), make_test(i) )
setattr(TestPickle, 'test' + str(i), make_test(i))
if __name__ == '__main__':
......
......@@ -266,6 +266,7 @@ class TestStuff(greentest.TestCase):
self.assertEqual(e.get(), 1)
def test_wait_error(self):
def x():
sleep(DELAY)
return 1
......@@ -293,6 +294,7 @@ class TestStuff(greentest.TestCase):
# works.
def raises_but_ignored():
raise ExpectedError("count")
def sleep_forever():
while True:
sleep(0.1)
......
......@@ -1000,7 +1000,6 @@ class ChunkedInputTests(TestCase):
self.assert_error(IOError, 'unexpected end of file while parsing chunked data')
class Expect100ContinueTests(TestCase):
validator = None
......
......@@ -25,6 +25,7 @@ are not leaked by the hub.
from __future__ import print_function
from _socket import socket
class Socket(socket):
"Something we can have a weakref to"
......
......@@ -33,6 +33,7 @@ class SimpleStreamServer(StreamServer):
finally:
fd.close()
class Settings:
ServerClass = StreamServer
ServerSubClass = SimpleStreamServer
......
......@@ -105,7 +105,7 @@ def compare_relaxed(a, b):
a_segments = a.count(':')
b_segments = b.count(':')
if a_segments and b_segments:
if a_segments == b_segments and a_segments in (4,5,6,7):
if a_segments == b_segments and a_segments in (4, 5, 6, 7):
return True
if a.rstrip(':').startswith(b.rstrip(':')) or b.rstrip(':').startswith(a.rstrip(':')):
return True
......@@ -245,8 +245,7 @@ class TestCase(greentest.TestCase):
# because it calls assertSequenceEqual, which highlights the exact
# difference in the tuple
msg = format_call(func, args)
self.assertEqual((msg,gevent_result), (msg,real_result))
self.assertEqual((msg, gevent_result), (msg, real_result))
class TestTypeError(TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment