From af5e08578e34e4b67d3e8d81f9a73e61e32d9dc0 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 7 Oct 2022 12:29:40 -0400 Subject: [PATCH] style: remove breadcrumb code that kept the temporary directory around That code was just there so I could test that my unit test really failed if the temporary directory was not deleted. --- readalongs/web_api.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/readalongs/web_api.py b/readalongs/web_api.py index 8a0580bc..acec26dc 100644 --- a/readalongs/web_api.py +++ b/readalongs/web_api.py @@ -328,13 +328,9 @@ async def convert_alignment( # noqa: C901 # Data privacy consideration: we have to make sure this temporary directory gets # deleted after the call returns, as we promise in the API documentation. - if True: - temp_dir_object = tempfile.TemporaryDirectory() - temp_dir_name = temp_dir_object.name - cleanup = BackgroundTask(temp_dir_object.cleanup) - else: - temp_dir_name = tempfile.mkdtemp() - cleanup = BackgroundTask(lambda: None) + temp_dir_object = tempfile.TemporaryDirectory() + temp_dir_name = temp_dir_object.name + cleanup = BackgroundTask(temp_dir_object.cleanup) prefix = os.path.join(temp_dir_name, "aligned") LOGGER.info(f"Temporary directory: {temp_dir_name}")