mirror of https://gitlab.com/litecord/litecord.git
tests: make test app fixture async
This commit is contained in:
parent
de4c5a5e75
commit
948627efd1
|
|
@ -36,7 +36,7 @@ from litecord.blueprints.auth import make_token
|
|||
|
||||
|
||||
@pytest.fixture(name="app")
|
||||
def _test_app(unused_tcp_port, event_loop):
|
||||
async def _test_app(unused_tcp_port):
|
||||
set_blueprints(main_app)
|
||||
main_app.config["_testing"] = True
|
||||
|
||||
|
|
@ -53,13 +53,13 @@ def _test_app(unused_tcp_port, event_loop):
|
|||
main_app.config["REGISTRATIONS"] = True
|
||||
|
||||
# make sure we're calling the before_serving hooks
|
||||
event_loop.run_until_complete(main_app.startup())
|
||||
await main_app.startup()
|
||||
|
||||
# https://docs.pytest.org/en/latest/fixture.html#fixture-finalization-executing-teardown-code
|
||||
yield main_app
|
||||
|
||||
# properly teardown
|
||||
event_loop.run_until_complete(main_app.shutdown())
|
||||
await main_app.shutdown()
|
||||
|
||||
|
||||
@pytest.fixture(name="test_cli")
|
||||
|
|
|
|||
Loading…
Reference in New Issue