Skip to content

Commit 250b924

Browse files
authored
Fix test param for pytest-xdist (#1382)
1 parent b711b10 commit 250b924

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_gateway.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,12 @@ def test_gateway_request_timeout_pad_option(
373373
GatewayClient.clear_instance()
374374

375375

376-
cookie_expire_time = format_datetime(datetime.now(tz=timezone.utc) + timedelta(seconds=180))
377-
378-
379376
@pytest.mark.parametrize(
380377
"accept_cookies,expire_arg,expire_param,existing_cookies,cookie_exists",
381378
[
382379
(False, None, None, "EXISTING=1", False),
383380
(True, None, None, "EXISTING=1", True),
384-
(True, "Expires", cookie_expire_time, None, True),
381+
(True, "Expires", 180, None, True),
385382
(True, "Max-Age", "-360", "EXISTING=1", False),
386383
],
387384
)
@@ -400,6 +397,10 @@ def test_gateway_request_with_expiring_cookies(
400397

401398
cookie: SimpleCookie = SimpleCookie()
402399
cookie.load("SERVERID=1234567; Path=/")
400+
if expire_arg == "Expires":
401+
expire_param = format_datetime(
402+
datetime.now(tz=timezone.utc) + timedelta(seconds=expire_param)
403+
)
403404
if expire_arg:
404405
cookie["SERVERID"][expire_arg] = expire_param
405406

0 commit comments

Comments
 (0)