Skip to content

Commit

Permalink
add event_loop fixture for MockLoop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 15, 2021
1 parent 69e81e8 commit 7223d4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/protocols/test_http.py
Expand Up @@ -185,6 +185,12 @@ def get_connected_protocol(app, protocol_cls, event_loop, **kwargs):
asyncio._set_running_loop(None)


@pytest.fixture
def event_loop():
with contextlib.closing(asyncio.new_event_loop()) as loop:
yield loop


@pytest.mark.parametrize("protocol_cls", HTTP_PROTOCOLS)
def test_get_request(protocol_cls, event_loop):
app = Response("Hello, world", media_type="text/plain")
Expand Down

0 comments on commit 7223d4d

Please sign in to comment.