Skip to content

Commit

Permalink
Fix test param for pytest-xdist (#1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria authored Jan 5, 2024
1 parent b711b10 commit 250b924
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
)
Expand All @@ -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

Expand Down

0 comments on commit 250b924

Please sign in to comment.