Skip to content

Commit

Permalink
reduce code
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Nov 3, 2024
1 parent 319f13e commit db92393
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/test_benchmarks_http_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ async def _send_one_hundred_websocket_text_messages() -> None:
for _ in range(100):
await writer.send_frame(raw_message, WSMsgType.TEXT)

@benchmark
def _run() -> None:
loop.run_until_complete(_send_one_hundred_websocket_text_messages())
benchmark(loop.run_until_complete(_send_one_hundred_websocket_text_messages()))


def test_send_one_hundred_large_websocket_text_messages(
Expand All @@ -80,9 +78,7 @@ async def _send_one_hundred_websocket_text_messages() -> None:
for _ in range(100):
await writer.send_frame(raw_message, WSMsgType.TEXT)

@benchmark
def _run() -> None:
loop.run_until_complete(_send_one_hundred_websocket_text_messages())
benchmark(loop.run_until_complete(_send_one_hundred_websocket_text_messages()))


def test_send_one_hundred_websocket_text_messages_with_mask(
Expand All @@ -96,6 +92,4 @@ async def _send_one_hundred_websocket_text_messages() -> None:
for _ in range(100):
await writer.send_frame(raw_message, WSMsgType.TEXT)

@benchmark
def _run() -> None:
loop.run_until_complete(_send_one_hundred_websocket_text_messages())
benchmark(loop.run_until_complete(_send_one_hundred_websocket_text_messages()))

0 comments on commit db92393

Please sign in to comment.