1616from jupyter_core .utils import ensure_async
1717from tornado .concurrent import Future
1818from tornado .httpclient import HTTPRequest , HTTPResponse
19- from tornado .httputil import HTTPServerRequest , HTTPHeaders
19+ from tornado .httputil import HTTPHeaders , HTTPServerRequest
2020from tornado .queues import Queue
2121from tornado .web import HTTPError
2222from traitlets import Int , Unicode
@@ -372,6 +372,7 @@ def test_gateway_request_timeout_pad_option(
372372
373373 GatewayClient .clear_instance ()
374374
375+
375376@pytest .mark .parametrize (
376377 "accept_cookies,expire_arg,expire_param,existing_cookies" ,
377378 [
@@ -399,8 +400,9 @@ def test_gateway_request_with_expiring_cookies(
399400 cookie_value = "SERVERID=1234567; Path=/; HttpOnly"
400401 if expire_arg == "expires" :
401402 # Convert expire_param to a string in the format of "Expires: <date>" (RFC 7231)
402- expire_param = (datetime .now (tz = timezone .utc ) + timedelta (seconds = expire_param ))\
403- .strftime ("%a, %d %b %Y %H:%M:%S GMT" )
403+ expire_param = (datetime .now (tz = timezone .utc ) + timedelta (seconds = expire_param )).strftime (
404+ "%a, %d %b %Y %H:%M:%S GMT"
405+ )
404406 cookie_value = f"SERVERID=1234567; Path=/; expires={ expire_param } ; HttpOnly"
405407 elif expire_arg == "Max-Age" :
406408 cookie_value = f"SERVERID=1234567; Path=/; Max-Age={ expire_param } ; HttpOnly"
@@ -421,7 +423,7 @@ def test_gateway_request_with_expiring_cookies(
421423 connection_args = GatewayClient .instance ().load_connection_args (** args )
422424
423425 if not accept_cookies or test_expiration :
424- # The first condition ensure the response cookie is not accepted,
426+ # The first condition ensure the response cookie is not accepted,
425427 # the second condition ensures that the cookie is not accepted if it is expired.
426428 assert "SERVERID" not in connection_args ["headers" ].get ("Cookie" )
427429 else :
0 commit comments