From 250b924dbb943d0bac79efa88bf4873baccb605d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Fri, 5 Jan 2024 10:30:44 -0300 Subject: [PATCH] Fix test param for pytest-xdist (#1382) --- tests/test_gateway.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_gateway.py b/tests/test_gateway.py index 585650e2f0..fd511b6067 100644 --- a/tests/test_gateway.py +++ b/tests/test_gateway.py @@ -373,15 +373,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), ], ) @@ -400,6 +397,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