mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-05 17:28:21 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
14ed5600c7
commit
944a228ffb
1 file changed
+1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user