fix(#151): Fix linting violations in compaction tests
Fixed code review findings: - Removed unused imports (MagicMock, ContextUsage) - Fixed import sorting violations All 41 tests still passing after fixes.
This commit is contained in:
@@ -6,11 +6,11 @@ Context compaction reduces memory usage by:
|
||||
3. Measuring context reduction achieved
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
from src.context_compaction import ContextCompactor, CompactionResult
|
||||
from src.models import ContextUsage
|
||||
import pytest
|
||||
|
||||
from src.context_compaction import CompactionResult, ContextCompactor
|
||||
|
||||
|
||||
class TestContextCompactor:
|
||||
|
||||
@@ -325,6 +325,7 @@ class TestContextMonitor:
|
||||
) -> None:
|
||||
"""Should perform compaction when COMPACT action is triggered."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from src.context_compaction import CompactionResult
|
||||
|
||||
# Mock compaction result
|
||||
@@ -365,6 +366,7 @@ class TestContextMonitor:
|
||||
) -> None:
|
||||
"""Should log compaction metrics when compaction is performed."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from src.context_compaction import CompactionResult
|
||||
|
||||
mock_compaction_result = CompactionResult(
|
||||
@@ -402,6 +404,7 @@ class TestContextMonitor:
|
||||
) -> None:
|
||||
"""Should handle compaction failure and log error."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from src.context_compaction import CompactionResult
|
||||
|
||||
mock_compaction_result = CompactionResult(
|
||||
|
||||
Reference in New Issue
Block a user