diff --git a/tests/test_issue_145_production_error_handler.py b/tests/test_issue_145_production_error_handler.py index 34925ea5..e5f7e238 100644 --- a/tests/test_issue_145_production_error_handler.py +++ b/tests/test_issue_145_production_error_handler.py @@ -20,7 +20,7 @@ from markitect.production.error_handler import ( ResourceExhaustionError ) try: - from .test_utils import test_workspace + from .test_utils import workspace_context except ImportError: # Fallback for missing test utilities import tempfile @@ -29,16 +29,13 @@ except ImportError: import shutil @contextmanager - def _test_workspace_fallback(name=None): + def workspace_context(name=None): temp_dir = Path(tempfile.mkdtemp(prefix=f"{name}_" if name else "test_")) try: yield temp_dir finally: shutil.rmtree(temp_dir, ignore_errors=True) - # Assign to expected name - test_workspace = _test_workspace_fallback - class TestProductionErrorHandler: """Test production error handling and recovery capabilities.""" @@ -46,7 +43,7 @@ class TestProductionErrorHandler: @pytest.fixture def temp_workspace(self): """Create temporary workspace for testing.""" - with test_workspace("error_handler") as temp_dir: + with workspace_context("error_handler") as temp_dir: yield temp_dir @pytest.fixture diff --git a/tests/test_utils.py b/tests/test_utils.py index eeecdb7e..b63a9484 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -38,7 +38,7 @@ def create_test_workspace(prefix: str = "test") -> Path: @contextmanager -def test_workspace(prefix: str = "test"): +def workspace_context(prefix: str = "test"): """Context manager for test workspace that auto-cleans up. Args: