chore(lint): apply ruff --fix (4443 auto-fixes)
Auto-fixed categories: - F401: unused imports removed - I001: import blocks sorted - W293: trailing whitespace stripped - UP035: deprecated typing imports replaced - SIM: simplify suggestions applied - ARG: unused args prefixed with underscore - T201: print statements removed - F841: unused variables removed - RUF059: unpacked variables prefixed Remaining ~1500 unfixable errors (C901, B904, N806, E402) require manual work. Backend smoke tests: 13/13 passed.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import os
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
# Mock database before any modules that import it are loaded
|
||||
@@ -22,18 +23,18 @@ class TestPluginSmoke:
|
||||
syntax errors, missing class declarations).
|
||||
"""
|
||||
from src.core.plugin_loader import PluginLoader
|
||||
|
||||
|
||||
plugin_dir = os.path.join(str(Path(__file__).parent.parent), "src", "plugins")
|
||||
|
||||
|
||||
# This will discover and instantiate plugins
|
||||
loader = PluginLoader(plugin_dir)
|
||||
|
||||
plugins = loader.get_all_plugin_configs()
|
||||
plugin_ids = {p.id for p in plugins}
|
||||
|
||||
|
||||
# We expect at least the migration and git plugins to be present
|
||||
expected_plugins = {"superset-migration", "git-integration"}
|
||||
|
||||
|
||||
missing_plugins = expected_plugins - plugin_ids
|
||||
assert not missing_plugins, f"Missing expected plugins: {missing_plugins}"
|
||||
|
||||
@@ -44,21 +45,21 @@ class TestPluginSmoke:
|
||||
"""
|
||||
from src.core.plugin_loader import PluginLoader
|
||||
from src.core.task_manager.manager import TaskManager
|
||||
|
||||
|
||||
plugin_dir = os.path.join(str(Path(__file__).parent.parent), "src", "plugins")
|
||||
loader = PluginLoader(plugin_dir)
|
||||
|
||||
|
||||
# Initialize TaskManager with real loader
|
||||
with patch("src.core.task_manager.manager.TaskPersistenceService") as MockPersistence, \
|
||||
patch("src.core.task_manager.manager.TaskLogPersistenceService"):
|
||||
|
||||
|
||||
MockPersistence.return_value.load_tasks.return_value = []
|
||||
|
||||
|
||||
with patch("src.dependencies.config_manager"):
|
||||
manager = TaskManager(loader)
|
||||
|
||||
|
||||
# Stop the flusher thread to prevent hanging
|
||||
manager._flusher_stop_event.set()
|
||||
manager._flusher_thread.join(timeout=2)
|
||||
|
||||
|
||||
assert manager is not None
|
||||
|
||||
Reference in New Issue
Block a user