Skip to content

Commit c68700b

Browse files
committed
lint
1 parent 037e7be commit c68700b

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

tests/unit/test_qdrant_index.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
1-
"""Unit tests for QdrantIndex — uses in-memory or file-based Qdrant, no server needed."""
2-
import sys
1+
"""Unit tests for QdrantIndex — uses in-memory Qdrant, no server needed."""
32
import uuid
4-
from pathlib import Path
53

64
import numpy as np
75
import pytest
8-
9-
# Ensure the local development copy of semantic-router takes precedence over any
10-
# installed version so tests always exercise the code in this repo.
11-
_repo_root = str(Path(__file__).resolve().parents[2])
12-
if _repo_root not in sys.path:
13-
sys.path.insert(0, _repo_root)
14-
15-
pytest.importorskip("qdrant_client", reason="qdrant-client not installed")
16-
176
from qdrant_client import models
187

198
from semantic_router.index.qdrant import (
209
SR_ROUTE_PAYLOAD_KEY,
21-
SR_UTTERANCE_PAYLOAD_KEY,
2210
QdrantIndex,
2311
)
2412

13+
pytest.importorskip("qdrant_client", reason="qdrant-client not installed")
14+
2515
DIMS = 4
2616

2717

@@ -129,7 +119,8 @@ def test_namespace_with_base(self):
129119
assert len(f.must) == 2
130120
# One element must be the namespace FieldCondition
131121
ns_items = [
132-
c for c in f.must
122+
c
123+
for c in f.must
133124
if isinstance(c, models.FieldCondition) and c.key == "namespace"
134125
]
135126
assert len(ns_items) == 1
@@ -177,7 +168,9 @@ def test_creates_payload_index_for_namespace(self):
177168
class TestAdd:
178169
def test_add_writes_points(self):
179170
idx = make_index()
180-
idx.add(embeddings=rand_vecs(2), routes=["r1", "r1"], utterances=["hello", "hi"])
171+
idx.add(
172+
embeddings=rand_vecs(2), routes=["r1", "r1"], utterances=["hello", "hi"]
173+
)
181174
assert len(idx.get_utterances()) == 2
182175

183176
def test_add_injects_namespace_payload(self):

0 commit comments

Comments
 (0)