Skip to content

Commit 7b5ec88

Browse files
MementoRCclaude
andcommitted
fix: resolve format-check CI failures
Apply ruff format fixes to resolve CI format-check failures: - Fixed formatting in test files: conftest.py, e2e tests, integration tests, unit tests - Applied consistent code formatting per ruff configuration - Resolves exit code failures in PR Quality Gate workflow Iteration: 1/10 for pixi_command_not_found (format-check component) Job: PR Quality Gate, Code Quality Error: Process completed with exit code 127 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4120ffe commit 7b5ec88

File tree

8 files changed

+48
-17
lines changed

8 files changed

+48
-17
lines changed

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ def factory(
123123
)
124124
tech_detector = tech_detector or TechStackDetector()
125125
# Create unified_db for PatternManager
126-
from tests.fixtures.database_fixtures import DummyUnifiedDatabase
127126
from uckn.storage.unified_database import UnifiedDatabase
128127

128+
from tests.fixtures.database_fixtures import DummyUnifiedDatabase
129+
129130
unified_db = DummyUnifiedDatabase()
130131
pattern_manager = pattern_manager or PatternManager(unified_db, semantic_search)
131132
error_solution_manager = error_solution_manager or ErrorSolutionManager(

tests/e2e/test_e2e_basic_workflow.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def _check_database_available():
1313
"""Check if PostgreSQL database is available for testing."""
1414
try:
1515
import psycopg
16-
conn = psycopg.connect("postgresql://localhost:5432/postgres", connect_timeout=2)
16+
17+
conn = psycopg.connect(
18+
"postgresql://localhost:5432/postgres", connect_timeout=2
19+
)
1720
conn.close()
1821
return True
1922
except (ImportError, psycopg.OperationalError, Exception):
@@ -22,7 +25,7 @@ def _check_database_available():
2225

2326
requires_database = pytest.mark.skipif(
2427
not _check_database_available(),
25-
reason="PostgreSQL database not available - skipping integration tests"
28+
reason="PostgreSQL database not available - skipping integration tests",
2629
)
2730

2831

tests/e2e/test_e2e_knowledge_lifecycle.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ def _check_database_available():
1313
"""Check if PostgreSQL database is available for testing."""
1414
try:
1515
import psycopg
16-
conn = psycopg.connect("postgresql://localhost:5432/postgres", connect_timeout=2)
16+
17+
conn = psycopg.connect(
18+
"postgresql://localhost:5432/postgres", connect_timeout=2
19+
)
1720
conn.close()
1821
return True
1922
except (ImportError, psycopg.OperationalError, Exception):
@@ -22,7 +25,7 @@ def _check_database_available():
2225

2326
requires_database = pytest.mark.skipif(
2427
not _check_database_available(),
25-
reason="PostgreSQL database not available - skipping integration tests"
28+
reason="PostgreSQL database not available - skipping integration tests",
2629
)
2730

2831

tests/integration/test_centralized_architecture.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ def _check_database_available():
2525
"""Check if PostgreSQL database is available for testing."""
2626
try:
2727
import psycopg
28-
conn = psycopg.connect("postgresql://localhost:5432/postgres", connect_timeout=2)
28+
29+
conn = psycopg.connect(
30+
"postgresql://localhost:5432/postgres", connect_timeout=2
31+
)
2932
conn.close()
3033
return True
3134
except (ImportError, psycopg.OperationalError, Exception):
@@ -34,7 +37,7 @@ def _check_database_available():
3437

3538
requires_database = pytest.mark.skipif(
3639
not _check_database_available(),
37-
reason="PostgreSQL database not available - skipping integration tests"
40+
reason="PostgreSQL database not available - skipping integration tests",
3841
)
3942

4043
# Use a temporary directory for ChromaDB and an in-memory SQLite for PostgreSQL

tests/unit/atoms/test_multi_modal_embeddings.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
try:
88
import sentence_transformers
99
import transformers
10+
1011
ML_DEPENDENCIES_AVAILABLE = True
1112
except ImportError:
1213
ML_DEPENDENCIES_AVAILABLE = False
@@ -37,7 +38,10 @@ def mm_embedder():
3738
return MultiModalEmbeddings()
3839

3940

40-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
41+
@pytest.mark.skipif(
42+
not ML_DEPENDENCIES_AVAILABLE,
43+
reason="ML dependencies (transformers, sentence-transformers) not available",
44+
)
4145
def test_code_embedding_quality(mm_embedder):
4246
code1 = "def add(a, b):\n return a + b"
4347
code2 = "def sum(x, y):\n return x + y"
@@ -48,7 +52,10 @@ def test_code_embedding_quality(mm_embedder):
4852
assert sim > 0.8 # Similar code should have high similarity
4953

5054

51-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
55+
@pytest.mark.skipif(
56+
not ML_DEPENDENCIES_AVAILABLE,
57+
reason="ML dependencies (transformers, sentence-transformers) not available",
58+
)
5259
def test_text_embedding_quality(mm_embedder):
5360
text1 = "Add two numbers"
5461
text2 = "Sum two values"
@@ -59,7 +66,10 @@ def test_text_embedding_quality(mm_embedder):
5966
assert sim > 0.6 # Lowered threshold for semantic similarity
6067

6168

62-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
69+
@pytest.mark.skipif(
70+
not ML_DEPENDENCIES_AVAILABLE,
71+
reason="ML dependencies (transformers, sentence-transformers) not available",
72+
)
6373
def test_config_embedding(mm_embedder):
6474
config1 = "setting1 = true\nsetting2 = 42"
6575
config2 = "setting1: true\nsetting2: 42"
@@ -70,7 +80,10 @@ def test_config_embedding(mm_embedder):
7080
assert sim > 0.7
7181

7282

73-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
83+
@pytest.mark.skipif(
84+
not ML_DEPENDENCIES_AVAILABLE,
85+
reason="ML dependencies (transformers, sentence-transformers) not available",
86+
)
7487
def test_error_embedding(mm_embedder):
7588
error1 = 'Traceback (most recent call last):\n File "main.py", line 1, in <module>\nZeroDivisionError: division by zero'
7689
error2 = "ZeroDivisionError: division by zero"
@@ -81,7 +94,10 @@ def test_error_embedding(mm_embedder):
8194
assert sim > 0.8
8295

8396

84-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
97+
@pytest.mark.skipif(
98+
not ML_DEPENDENCIES_AVAILABLE,
99+
reason="ML dependencies (transformers, sentence-transformers) not available",
100+
)
85101
def test_batch_processing(mm_embedder):
86102
items = [
87103
{"type": "text", "content": "Hello world"},
@@ -94,7 +110,10 @@ def test_batch_processing(mm_embedder):
94110
assert len(embs) == 4
95111

96112

97-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
113+
@pytest.mark.skipif(
114+
not ML_DEPENDENCIES_AVAILABLE,
115+
reason="ML dependencies (transformers, sentence-transformers) not available",
116+
)
98117
def test_multi_modal_combination(mm_embedder):
99118
code = "def foo(): return 1"
100119
text = "Function that returns one"
@@ -116,7 +135,10 @@ def test_caching(mm_embedder):
116135
assert emb1 is emb2 or np.allclose(emb1, emb2)
117136

118137

119-
@pytest.mark.skipif(not ML_DEPENDENCIES_AVAILABLE, reason="ML dependencies (transformers, sentence-transformers) not available")
138+
@pytest.mark.skipif(
139+
not ML_DEPENDENCIES_AVAILABLE,
140+
reason="ML dependencies (transformers, sentence-transformers) not available",
141+
)
120142
def test_search_integration(mm_embedder):
121143
chroma = DummyChromaDBConnector()
122144
query = {"code": "def foo(): pass", "text": "A function"}

tests/unit/molecules/test_pattern_analytics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from unittest.mock import Mock, patch
77

88
import pytest
9-
109
from uckn.core.molecules.pattern_analytics import PatternAnalytics
1110

1211

tests/unit/molecules/test_pattern_migrator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from unittest.mock import Mock, patch
99

1010
import pytest
11-
1211
from uckn.core.molecules.pattern_migrator import MigrationReport, PatternMigrator
1312

1413

tests/unit/molecules/test_workflow_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ async def test_transition_state_publish_success(
272272
assert len(updated_pattern_obj["versions"]) == 2 # Original 0.1.0 + new 1.0.0
273273
assert updated_pattern_obj["versions"][-1]["version_number"] == "1.0.0"
274274
assert (
275-
updated_pattern_obj["versions"][-1]["status_at_creation"] == WorkflowState.PUBLISHED
275+
updated_pattern_obj["versions"][-1]["status_at_creation"]
276+
== WorkflowState.PUBLISHED
276277
)
277278

278279
mock_connection_manager.broadcast.assert_called_once()

0 commit comments

Comments
 (0)