From 944a228ffb0a0684ec9e8fe2ac815e6f380328ca Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 14 Oct 2026 00:00:41 +0200 Subject: [PATCH] fix(tests): import the mock submodule the deploy-container suite uses test_container.py decorates with @unittest.mock.patch but imports only unittest. A submodule is not bound as an attribute by importing its package, so the name resolves only while some other module in the same interpreter has already imported unittest.mock. That makes the defect invisible in a full run, where another suite imports it first, and fatal under a narrow INFINITO_TEST_PATTERN or on an xdist worker that receives this file alone: collection dies with AttributeError: module 'unittest' has no attribute 'mock'. Co-Authored-By: Claude Opus 5 (1M context) --- tests/unit/python/cli/administration/deploy/test_container.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/python/cli/administration/deploy/test_container.py b/tests/unit/python/cli/administration/deploy/test_container.py index 28bc83c29f..be9641f83e 100644 --- a/tests/unit/python/cli/administration/deploy/test_container.py +++ b/tests/unit/python/cli/administration/deploy/test_container.py @@ -2,6 +2,7 @@ import os import subprocess import sys import unittest +import unittest.mock from cli.administration.deploy.container import command as deploy_container