fix flake8 linelength errors

This commit is contained in:
Alec Buckenheimer 2018-10-01 09:46:18 -04:00
parent efbacc17cf
commit 9a08bdae4a
2 changed files with 18 additions and 12 deletions

View File

@ -147,18 +147,23 @@ if base is not None:
self.notify()
req_count = sum(
self.servers[srv]["requests_count"] for srv in self.servers
srv['requests_count'] for srv in self.servers.values()
)
if self.max_requests and req_count > self.max_requests:
self.alive = False
self.log.info("Max requests exceeded, shutting down: %s",
self)
self.log.info(
"Max requests exceeded, shutting down: %s",
self
)
elif pid == os.getpid() and self.ppid != os.getppid():
self.alive = False
self.log.info("Parent changed, shutting down: %s", self)
self.log.info(
"Parent changed, shutting down: %s",
self
)
else:
await asyncio.sleep(1.0, loop=self.loop)
except (Exception, BaseException, GeneratorExit, KeyboardInterrupt):
except (BaseException, GeneratorExit, KeyboardInterrupt):
pass
@staticmethod

View File

@ -173,33 +173,34 @@ def test_route_strict_slashes_set_to_false_and_host_is_a_list(app):
# before fix, this raises a RouteExists error
@app.get('/get', host=[site1, 'site2.com'], strict_slashes=False)
def handler(request):
def get_handler(request):
return text('OK')
request, response = app.test_client.get('http://' + site1 + '/get')
assert response.text == 'OK'
@app.post('/post', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
@app.post('/post', host=[site1, 'site2.com'], strict_slashes=False)
def post_handler(request):
return text('OK')
request, response = app.test_client.post('http://' + site1 + '/post')
assert response.text == 'OK'
@app.put('/put', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
@app.put('/put', host=[site1, 'site2.com'], strict_slashes=False)
def put_handler(request):
return text('OK')
request, response = app.test_client.put('http://' + site1 + '/put')
assert response.text == 'OK'
@app.delete('/delete', host=[site1, 'site2.com'], strict_slashes=False) # noqa
def handler(request):
@app.delete('/delete', host=[site1, 'site2.com'], strict_slashes=False)
def delete_handler(request):
return text('OK')
request, response = app.test_client.delete('http://' + site1 + '/delete')
assert response.text == 'OK'
def test_shorthand_routes_post(app):
@app.post('/post')