From fbc2c828ec36d862b0e4c6157142abf552d25a0d Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 20 Sep 2024 15:37:43 +0200 Subject: [PATCH] fix(tests): do not place recorded.zip into the destdir instead, download it to a temp location, as the Prophecy (and authors of urlretrieve) foretold --- tests/ui_tests/reporting/download.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/ui_tests/reporting/download.py b/tests/ui_tests/reporting/download.py index 72806d6067..a94f3fddbe 100644 --- a/tests/ui_tests/reporting/download.py +++ b/tests/ui_tests/reporting/download.py @@ -15,17 +15,16 @@ FIXTURES_CURRENT = Path(__file__).resolve().parent.parent / "fixtures.json" def fetch_recorded(hash: str, path: Path) -> None: zip_src = RECORDS_WEBSITE + hash + ".zip" - zip_dest = path / "recorded.zip" try: - urllib.request.urlretrieve(zip_src, zip_dest) + dest, _ = urllib.request.urlretrieve(zip_src) except urllib.error.HTTPError: raise RuntimeError(f"No such recorded collection was found on '{zip_src}'.") - with zipfile.ZipFile(zip_dest, "r") as z: + with zipfile.ZipFile(dest, "r") as z: z.extractall(path) - zip_dest.unlink() + Path(dest).unlink() def fetch_fixtures_master() -> dict[str, Any]: