style: Fix ruff linting errors

- Fix bare except in chroma.py
- Fix whitespace issues in test_cloud_storage.py
- Auto-fixes from ruff --fix
This commit is contained in:
yusyus
2026-02-08 14:31:01 +03:00
parent 7a459cb9cb
commit ec512fe166
2 changed files with 14 additions and 15 deletions

View File

@@ -287,7 +287,7 @@ class ChromaAdaptor(SkillAdaptor):
# Try to get existing collection
collection = client.get_collection(name=collection_name)
print(f" Using existing collection: {collection_name}")
except:
except Exception:
try:
# Create new collection
metadata = {"hnsw:space": distance_function}

View File

@@ -3,7 +3,6 @@ Tests for cloud storage adaptors.
"""
import os
import sys
import pytest
import tempfile
from pathlib import Path
@@ -87,7 +86,7 @@ def test_s3_upload_file():
"""Test S3 file upload."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -115,7 +114,7 @@ def test_s3_download_file():
"""Test S3 file download."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -139,7 +138,7 @@ def test_s3_list_files():
"""Test S3 file listing."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -177,7 +176,7 @@ def test_s3_file_exists():
"""Test S3 file existence check."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -195,7 +194,7 @@ def test_s3_get_file_url():
"""Test S3 presigned URL generation."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -220,7 +219,7 @@ def test_gcs_upload_file():
"""Test GCS file upload."""
if not GCS_AVAILABLE:
pytest.skip("google-cloud-storage not installed")
with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage:
# Setup mocks
mock_client = Mock()
@@ -252,7 +251,7 @@ def test_gcs_download_file():
"""Test GCS file download."""
if not GCS_AVAILABLE:
pytest.skip("google-cloud-storage not installed")
with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage:
# Setup mocks
mock_client = Mock()
@@ -278,7 +277,7 @@ def test_gcs_list_files():
"""Test GCS file listing."""
if not GCS_AVAILABLE:
pytest.skip("google-cloud-storage not installed")
with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage:
# Setup mocks
mock_client = Mock()
@@ -311,7 +310,7 @@ def test_azure_upload_file():
"""Test Azure file upload."""
if not AZURE_AVAILABLE:
pytest.skip("azure-storage-blob not installed")
with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service:
# Setup mocks
mock_service_client = Mock()
@@ -344,7 +343,7 @@ def test_azure_download_file():
"""Test Azure file download."""
if not AZURE_AVAILABLE:
pytest.skip("azure-storage-blob not installed")
with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service:
# Setup mocks
mock_service_client = Mock()
@@ -375,7 +374,7 @@ def test_azure_list_files():
"""Test Azure file listing."""
if not AZURE_AVAILABLE:
pytest.skip("azure-storage-blob not installed")
with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service:
# Setup mocks
mock_service_client = Mock()
@@ -435,7 +434,7 @@ def test_upload_directory():
"""Test directory upload."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()
@@ -462,7 +461,7 @@ def test_download_directory():
"""Test directory download."""
if not BOTO3_AVAILABLE:
pytest.skip("boto3 not installed")
with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3:
# Setup mocks
mock_client = Mock()