Skip to content

Commit

Permalink
add the setUp/tearDown code back to 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 9, 2022
1 parent 355dc8e commit 37fa089
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aiohttp/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ def get_app(self) -> Application:
"""
raise RuntimeError("Did you forget to define get_application()?")

def setUp(self) -> None:
if not PY_38:
asyncio.get_event_loop().run_until_complete(self.asyncSetUp())

async def asyncSetUp(self) -> None:
self.loop = asyncio.get_running_loop()
return await self.setUpAsync()
Expand All @@ -440,6 +444,10 @@ async def setUpAsync(self) -> None:

await self.client.start_server()

def tearDown(self) -> None:
if not PY_38:
self.loop.run_until_complete(self.asyncTearDown())

async def asyncTearDown(self) -> None:
return await self.tearDownAsync()

Expand Down

0 comments on commit 37fa089

Please sign in to comment.