Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 21, 2024
1 parent 76c03e7 commit 59ab45f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions playwright/_impl/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,14 @@ async def _inner_continue(self, is_fallback: bool = False) -> None:
{
"url": options.url,
"method": options.method,
"headers": serialize_headers(options.headers)
if options.headers
else None,
"postData": base64.b64encode(options.post_data_buffer).decode()
if options.post_data_buffer is not None
else None,
"headers": (
serialize_headers(options.headers) if options.headers else None
),
"postData": (
base64.b64encode(options.post_data_buffer).decode()
if options.post_data_buffer is not None
else None
),
"isFallback": is_fallback,
},
)
Expand Down Expand Up @@ -603,9 +605,9 @@ def __init__(
super().__init__(parent, type, guid, initializer)
self.mark_as_internal_type()
self._on_page_message: Optional[Callable[[Union[str, bytes]], Any]] = None
self._on_page_close: Optional[
Callable[[Optional[int], Optional[str]], Any]
] = None
self._on_page_close: Optional[Callable[[Optional[int], Optional[str]], Any]] = (
None
)
self._on_server_message: Optional[Callable[[Union[str, bytes]], Any]] = None
self._on_server_close: Optional[
Callable[[Optional[int], Optional[str]], Any]
Expand Down
2 changes: 1 addition & 1 deletion tests/async/test_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ async def test_goto_should_fail_when_main_resources_failed_to_load(
if is_chromium:
assert "net::ERR_CONNECTION_REFUSED" in exc_info.value.message
elif is_webkit and is_win:
assert "Couldn't connect to server" in exc_info.value.message
assert "Could not connect to server" in exc_info.value.message
elif is_webkit:
assert "Could not connect" in exc_info.value.message
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/sync/test_route_web_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _handle_ws(ws: WebSocketRoute) -> None:
"close code=3009 reason=oops wasClean=true",
],
)
assert closed_event == [(3009, "oops")]
assert_equal(lambda: closed_event, [(3009, "oops")])


def test_should_pattern_match(page: Page, server: Server) -> None:
Expand Down

0 comments on commit 59ab45f

Please sign in to comment.