Skip to content

Commit

Permalink
Added tests without explicit loop in TestAioHTTPTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
WisdomPill committed Nov 1, 2020
1 parent 884e4f7 commit f39d103
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def test_example_with_loop(self) -> None:
text = await request.text()
assert _hello_world_str == text

def test_example(self) -> None:
def test_inner_example(self) -> None:
async def test_get_route() -> None:
resp = await self.client.request("GET", "/")
assert resp.status == 200
Expand All @@ -104,6 +104,21 @@ async def test_get_route() -> None:

self.loop.run_until_complete(test_get_route())

async def test_example_without_explicit_loop(self) -> None:
request = await self.client.request("GET", "/")
assert request.status == 200
text = await request.text()
assert _hello_world_str == text

async def test_inner_example_without_explicit_loop(self) -> None:
async def test_get_route() -> None:
resp = await self.client.request("GET", "/")
assert resp.status == 200
text = await resp.text()
assert _hello_world_str == text

await test_get_route()


def test_get_route(loop, test_client) -> None:
async def test_get_route() -> None:
Expand Down

0 comments on commit f39d103

Please sign in to comment.