Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Mar 5, 2024
1 parent 28b4791 commit 4334659
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/async/test_fetch_browser_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def test_fetch_should_work(context: BrowserContext, server: Server) -> Non
async def test_should_throw_on_network_error(
context: BrowserContext, server: Server
) -> None:
server.set_route("/test", lambda request: request.transport.loseConnection())
server.set_route("/test", lambda request: request.loseConnection())
with pytest.raises(Error, match="socket hang up"):
await context.request.fetch(server.PREFIX + "/test")

Expand Down
2 changes: 1 addition & 1 deletion tests/async/test_har.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ async def test_should_ignore_aborted_requests(
tmpdir: Path,
) -> None:
path = tmpdir / "test.har"
server.set_route("/x", lambda request: request.transport.loseConnection())
server.set_route("/x", lambda request: request.loseConnection())
context1 = await context_factory()
await context1.route_from_har(har=path, update=True)
page1 = await context1.new_page()
Expand Down
2 changes: 1 addition & 1 deletion tests/async/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ async def test_network_events_request_failed(
) -> None:
def handle_request(request: TestServerRequest) -> None:
request.setHeader("Content-Type", "text/css")
request.transport.loseConnection()
request.loseConnection()

server.set_route("/one-style.css", handle_request)

Expand Down
2 changes: 1 addition & 1 deletion tests/sync/test_fetch_browser_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_fetch_should_work(context: BrowserContext, server: Server) -> None:


def test_should_throw_on_network_error(context: BrowserContext, server: Server) -> None:
server.set_route("/test", lambda request: request.transport.loseConnection())
server.set_route("/test", lambda request: request.loseConnection())
with pytest.raises(Error, match="socket hang up"):
context.request.fetch(server.PREFIX + "/test")

Expand Down

0 comments on commit 4334659

Please sign in to comment.