@@ -208,17 +208,17 @@ def test_merge_carries_max_confidence_and_count(self):
208208 ]
209209 pipeline ._container .query_items .return_value = iter (facts )
210210
211- with patch .object (
212- pipeline , "_cluster_by_similarity" , return_value = [[0 , 1 ]]
213- ), patch .object (
214- pipeline ,
215- "_run_prompty" ,
216- return_value = (
217- '{"actions":[{"action":"MERGE","source_ids":["f1","f2"],'
218- '"merged_text":"User likes coffee in the morning.","salience":0.7}]}'
211+ with (
212+ patch .object (pipeline , "_cluster_by_similarity" , return_value = [[0 , 1 ]]),
213+ patch .object (
214+ pipeline ,
215+ "_run_prompty" ,
216+ return_value = (
217+ '{"actions":[{"action":"MERGE","source_ids":["f1","f2"],'
218+ '"merged_text":"User likes coffee in the morning.","salience":0.7}]}'
219+ ),
219220 ),
220- ), patch .object (
221- pipeline , "_parse_llm_json" , side_effect = lambda s : json .loads (s )
221+ patch .object (pipeline , "_parse_llm_json" , side_effect = lambda s : json .loads (s )),
222222 ):
223223 pipeline .deduplicate_facts (user_id = "u1" )
224224
@@ -237,17 +237,16 @@ def test_merge_omits_confidence_when_no_sources_have_it(self):
237237 ]
238238 pipeline ._container .query_items .return_value = iter (facts )
239239
240- with patch . object (
241- pipeline , "_cluster_by_similarity" , return_value = [[0 , 1 ]]
242- ), patch .object (
243- pipeline ,
244- "_run_prompty" ,
245- return_value = (
246- '{"actions":[{"action":"MERGE","source_ids":["f1","f2"],'
247- '"merged_text":"merged","salience":0.5}]}'
240+ with (
241+ patch . object ( pipeline , "_cluster_by_similarity" , return_value = [[0 , 1 ]]),
242+ patch .object (
243+ pipeline ,
244+ "_run_prompty" ,
245+ return_value = (
246+ '{"actions":[{"action":"MERGE","source_ids":["f1","f2"],"merged_text":"merged","salience":0.5}]} '
247+ ),
248248 ),
249- ), patch .object (
250- pipeline , "_parse_llm_json" , side_effect = lambda s : json .loads (s )
249+ patch .object (pipeline , "_parse_llm_json" , side_effect = lambda s : json .loads (s )),
251250 ):
252251 pipeline .deduplicate_facts (user_id = "u1" )
253252
0 commit comments