@@ -262,9 +262,9 @@ def test__find_similar_embedding_pairs_jaccard(n_test_sets, max_len, threshold):
262
262
assert len (result ) == len (expected )
263
263
for i , j , similarity_float in result :
264
264
assert i < j , "Pairs should be ordered (i < j)"
265
- assert similarity_float >= threshold , (
266
- f"Similarity { similarity_float } should be >= { threshold } "
267
- )
265
+ assert (
266
+ similarity_float >= threshold
267
+ ), f"Similarity { similarity_float } should be >= { threshold } "
268
268
for x , y , expected_similarity in expected :
269
269
if i == x and j == y :
270
270
assert similarity_float == pytest .approx (expected_similarity )
@@ -277,9 +277,9 @@ async def test_no_self_similarity_relationships(self, simple_kg):
277
277
builder = JaccardSimilarityBuilder (property_name = "entities" , threshold = 0.1 )
278
278
relationships = await builder .transform (copy .deepcopy (simple_kg ))
279
279
for r in relationships :
280
- assert r . source . id != r . target . id , (
281
- "Self-relationships should not be created"
282
- )
280
+ assert (
281
+ r . source . id != r . target . id
282
+ ), "Self-relationships should not be created"
283
283
284
284
@pytest .mark .asyncio
285
285
async def test_no_duplicate_relationships (self , simple_kg ):
@@ -307,9 +307,9 @@ async def test_all_below_threshold(self):
307
307
kg = KnowledgeGraph (nodes = [node1 , node2 ])
308
308
builder = JaccardSimilarityBuilder (property_name = "entities" , threshold = 0.1 )
309
309
relationships = await builder .transform (kg )
310
- assert len ( relationships ) == 0 , (
311
- "No relationships should be created below threshold"
312
- )
310
+ assert (
311
+ len ( relationships ) == 0
312
+ ), "No relationships should be created below threshold"
313
313
314
314
@pytest .mark .asyncio
315
315
async def test_all_above_threshold (self ):
@@ -379,9 +379,9 @@ async def test_apply_transforms_cosine_similarity_builder(self, simple_kg):
379
379
# Should mutate kg in-place
380
380
apply_transforms (kg , builder , run_config = RunConfig (max_workers = 2 ))
381
381
# Check that relationships were added
382
- assert any (r . type == "jaccard_similarity" for r in kg . relationships ), (
383
- "No jaccard_similarity relationships found after apply_transforms"
384
- )
382
+ assert any (
383
+ r . type == " jaccard_similarity" for r in kg . relationships
384
+ ), "No jaccard_similarity relationships found after apply_transforms"
385
385
# Check that expected relationship exists
386
386
assert any (
387
387
str (r .source .id ) == "f353e5c2-e432-4d1e-84a8-d750c93d4edf"
0 commit comments