11"""Tests for the HTTP server."""
22
3- from http import HTTPStatus
43import os
54import queue
65import socket
98import types
109import urllib .parse # noqa: WPS301
1110import uuid
11+ from http import HTTPStatus
1212
1313import pytest
1414
@@ -575,15 +575,18 @@ def test_threadpool_multistart_validation(monkeypatch):
575575
576576def 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 = 20 )
605+ response = requests .get (f' http://127.0.0.1:{ port } ' , timeout = 20 )
603606 assert response .status_code == HTTPStatus .SERVICE_UNAVAILABLE .value
0 commit comments