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
|
3. Measuring context reduction achieved
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
from unittest.mock import AsyncMock
|
||||||
from unittest.mock import AsyncMock, MagicMock
|
|
||||||
|
|
||||||
from src.context_compaction import ContextCompactor, CompactionResult
|
import pytest
|
||||||
from src.models import ContextUsage
|
|
||||||
|
from src.context_compaction import CompactionResult, ContextCompactor
|
||||||
|
|
||||||
|
|
||||||
class TestContextCompactor:
|
class TestContextCompactor:
|
||||||
|
|||||||
@@ -325,6 +325,7 @@ class TestContextMonitor:
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Should perform compaction when COMPACT action is triggered."""
|
"""Should perform compaction when COMPACT action is triggered."""
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from src.context_compaction import CompactionResult
|
from src.context_compaction import CompactionResult
|
||||||
|
|
||||||
# Mock compaction result
|
# Mock compaction result
|
||||||
@@ -365,6 +366,7 @@ class TestContextMonitor:
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Should log compaction metrics when compaction is performed."""
|
"""Should log compaction metrics when compaction is performed."""
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from src.context_compaction import CompactionResult
|
from src.context_compaction import CompactionResult
|
||||||
|
|
||||||
mock_compaction_result = CompactionResult(
|
mock_compaction_result = CompactionResult(
|
||||||
@@ -402,6 +404,7 @@ class TestContextMonitor:
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Should handle compaction failure and log error."""
|
"""Should handle compaction failure and log error."""
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from src.context_compaction import CompactionResult
|
from src.context_compaction import CompactionResult
|
||||||
|
|
||||||
mock_compaction_result = CompactionResult(
|
mock_compaction_result = CompactionResult(
|
||||||
|
|||||||
Reference in New Issue
Block a user