tests.conftest: add teardown to prevent overuse of resources

This commit is contained in:
Luna 2019-03-16 21:13:10 -03:00
parent 169d22ad72
commit cc379df861
1 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,11 @@ def _test_app(unused_tcp_port, event_loop):
# make sure we're calling the before_serving hooks
event_loop.run_until_complete(main_app.startup())
return main_app
# 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())
@pytest.fixture(name='test_cli')