void-packages/srcpkgs/python3-jupyter_server/patches/pytest-xdist.patch
2023-10-10 12:29:16 -04:00

38 lines
1.3 KiB
Diff

commit 2dfc67655dd589948250c49c093bd25c4f08f77c
Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Date: Thu May 25 22:28:37 2023 -0300
Fix test param for pytest-xdist
diff --git a/tests/test_gateway.py b/tests/test_gateway.py
index fec747afe..8f7f8a463 100644
--- a/tests/test_gateway.py
+++ b/tests/test_gateway.py
@@ -362,15 +362,12 @@ def test_gateway_request_timeout_pad_option(
GatewayClient.clear_instance()
-cookie_expire_time = format_datetime(datetime.now(tz=timezone.utc) + timedelta(seconds=180))
-
-
@pytest.mark.parametrize(
"accept_cookies,expire_arg,expire_param,existing_cookies,cookie_exists",
[
(False, None, None, "EXISTING=1", False),
(True, None, None, "EXISTING=1", True),
- (True, "Expires", cookie_expire_time, None, True),
+ (True, "Expires", 180, None, True),
(True, "Max-Age", "-360", "EXISTING=1", False),
],
)
@@ -389,6 +386,10 @@ def test_gateway_request_with_expiring_cookies(
cookie: SimpleCookie = SimpleCookie()
cookie.load("SERVERID=1234567; Path=/")
+ if expire_arg == "Expires":
+ expire_param = format_datetime(
+ datetime.now(tz=timezone.utc) +
+ timedelta(seconds=expire_param))
if expire_arg:
cookie["SERVERID"][expire_arg] = expire_param