From a6ababc4e63fb43b6e54a89aa0f0b1ad33fea013 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 5 Aug 2025 10:45:22 +0200 Subject: [PATCH] test: unflake test_context_add_cookies_should_work --- tests/async/test_defaultbrowsercontext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/async/test_defaultbrowsercontext.py b/tests/async/test_defaultbrowsercontext.py index 25ef0c3f8..f5d2a606d 100644 --- a/tests/async/test_defaultbrowsercontext.py +++ b/tests/async/test_defaultbrowsercontext.py @@ -111,7 +111,7 @@ async def test_context_add_cookies_should_work( ] ) assert await page.evaluate("() => document.cookie") == "username=John Doe" - assert await page.context.cookies() == [ + assert _filter_cookies(await page.context.cookies()) == [ { "name": "username", "value": "John Doe", @@ -127,7 +127,7 @@ async def test_context_add_cookies_should_work( def _filter_cookies(cookies: Sequence[Cookie]) -> List[Cookie]: return list( - filter(lambda cookie: cookie["domain"] != "copilot.microsoft.com", cookies) + filter(lambda cookie: not cookie["domain"].endswith("microsoft.com"), cookies) )