From 70e58f1333d52520520d9bbf9a520cf25306d681 Mon Sep 17 00:00:00 2001 From: didericis Date: Thu, 9 Jul 2026 00:03:00 -0400 Subject: [PATCH] test: fix test_cache_miss and remove unused re import - test_smolmachines_launch_image: save mock now touches the tarball path so tarball.chmod(0o644) doesn't fail with FileNotFoundError - test_smolmachines_launch (integration): remove unused `re` import (pyright reportUnusedImport) Co-Authored-By: Claude Sonnet 4.6 --- tests/integration/test_smolmachines_launch.py | 1 - tests/unit/test_smolmachines_launch_image.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_smolmachines_launch.py b/tests/integration/test_smolmachines_launch.py index b4fc613..b93756a 100644 --- a/tests/integration/test_smolmachines_launch.py +++ b/tests/integration/test_smolmachines_launch.py @@ -28,7 +28,6 @@ from __future__ import annotations import os import platform -import re import shutil import tempfile import unittest diff --git a/tests/unit/test_smolmachines_launch_image.py b/tests/unit/test_smolmachines_launch_image.py index e767089..0f79dc5 100644 --- a/tests/unit/test_smolmachines_launch_image.py +++ b/tests/unit/test_smolmachines_launch_image.py @@ -94,6 +94,10 @@ class TestEnsureSmolmachine(unittest.TestCase): calls.append(name) return _f + def save_and_record(image_ref: str, path: str) -> None: + Path(path).touch() + calls.append("save") + with patch.object( _launch_mod.docker_mod, "build_image", side_effect=record("build"), @@ -102,7 +106,7 @@ class TestEnsureSmolmachine(unittest.TestCase): return_value=f"sha256:{digest}fffffffffffffffff", ), patch.object( _launch_mod.docker_mod, "save", - side_effect=record("save"), + side_effect=save_and_record, ) as save, patch.object( _launch_mod, "ephemeral_registry", return_value=_Reg(),