Skip to content

Commit 3fea01e

Browse files
authored
test: unflake test_context_add_cookies_should_work (#2935)
1 parent 7dc8b32 commit 3fea01e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/async/test_defaultbrowsercontext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def test_context_add_cookies_should_work(
111111
]
112112
)
113113
assert await page.evaluate("() => document.cookie") == "username=John Doe"
114-
assert await page.context.cookies() == [
114+
assert _filter_cookies(await page.context.cookies()) == [
115115
{
116116
"name": "username",
117117
"value": "John Doe",
@@ -127,7 +127,7 @@ async def test_context_add_cookies_should_work(
127127

128128
def _filter_cookies(cookies: Sequence[Cookie]) -> List[Cookie]:
129129
return list(
130-
filter(lambda cookie: cookie["domain"] != "copilot.microsoft.com", cookies)
130+
filter(lambda cookie: not cookie["domain"].endswith("microsoft.com"), cookies)
131131
)
132132

133133

0 commit comments

Comments
 (0)