Skip to content

Commit ead7721

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fee0ecb commit ead7721

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cheroot/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ def _serve_unservicable(self):
18761876
return
18771877
request = HTTPRequest(self, conn)
18781878
try:
1879-
request.simple_response("503 Service Unavailable")
1879+
request.simple_response('503 Service Unavailable')
18801880
except Exception as ex:
18811881
self.server.error_log(
18821882
repr(ex),

cheroot/test/test_server.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests for the HTTP server."""
22

3-
from http import HTTPStatus
43
import os
54
import queue
65
import socket
@@ -9,6 +8,7 @@
98
import types
109
import urllib.parse # noqa: WPS301
1110
import uuid
11+
from http import HTTPStatus
1212

1313
import pytest
1414

@@ -575,15 +575,18 @@ def test_threadpool_multistart_validation(monkeypatch):
575575

576576
def test_overload_results_in_suitable_http_error(request):
577577
"""A server that can't keep up with requests returns a 503 HTTP error."""
578-
localhost = "127.0.0.1"
578+
localhost = '127.0.0.1'
579579
httpserver = HTTPServer(
580580
bind_addr=(localhost, EPHEMERAL_PORT),
581-
gateway=Gateway
581+
gateway=Gateway,
582582
)
583583
# Can only handle on request in parallel:
584584
httpserver.requests = ThreadPool(
585-
min=1, max=1, accepted_queue_size=1,
586-
accepted_queue_timeout=0, server=httpserver
585+
min=1,
586+
max=1,
587+
accepted_queue_size=1,
588+
accepted_queue_timeout=0,
589+
server=httpserver,
587590
)
588591

589592
httpserver.prepare()
@@ -599,5 +602,5 @@ def test_overload_results_in_suitable_http_error(request):
599602
# requests fail:
600603
httpserver.requests._queue.put(None)
601604

602-
response = requests.get(f"http://127.0.0.1:{port}", timeout=5)
605+
response = requests.get(f'http://127.0.0.1:{port}', timeout=5)
603606
assert response.status_code == HTTPStatus.SERVICE_UNAVAILABLE.value

0 commit comments

Comments
 (0)