From ac3a7a494e12baf2ed7aa02794f74aca69a0335f Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 27 Nov 2023 13:25:41 +0100 Subject: [PATCH] Fix fixture cleanup --- tljh_repo2docker/tests/conftest.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tljh_repo2docker/tests/conftest.py b/tljh_repo2docker/tests/conftest.py index 0c26ee0..708ab3d 100644 --- a/tljh_repo2docker/tests/conftest.py +++ b/tljh_repo2docker/tests/conftest.py @@ -43,17 +43,11 @@ async def app(hub_app): tljh_custom_jupyterhub_config(config) app = await hub_app(config=config) - print(app) return app @pytest.fixture(autouse=True) async def remove_all_test_images(image_name, generated_image_name, app): - try: - yield - finally: - async def _clean(): - await remove_docker_image(image_name) - await remove_docker_image(generated_image_name) - - app.io_loop.run_sync(_clean) + yield + await remove_docker_image(image_name) + await remove_docker_image(generated_image_name)