@@ -91,9 +91,7 @@ def test_count_handles_list_content(tmp_path):
9191 {
9292 "message" : {
9393 "role" : "user" ,
94- "content" : [
95- {"type" : "text" , "text" : "<command-message>x</command-message>" }
96- ],
94+ "content" : [{"type" : "text" , "text" : "<command-message>x</command-message>" }],
9795 }
9896 },
9997 ],
@@ -221,10 +219,7 @@ def test_stop_hook_passthrough_below_interval(tmp_path):
221219 transcript = tmp_path / "t.jsonl"
222220 _write_transcript (
223221 transcript ,
224- [
225- {"message" : {"role" : "user" , "content" : f"msg { i } " }}
226- for i in range (SAVE_INTERVAL - 1 )
227- ],
222+ [{"message" : {"role" : "user" , "content" : f"msg { i } " }} for i in range (SAVE_INTERVAL - 1 )],
228223 )
229224 result = _capture_hook_output (
230225 hook_stop ,
@@ -242,10 +237,7 @@ def test_stop_hook_blocks_at_interval(tmp_path):
242237 transcript = tmp_path / "t.jsonl"
243238 _write_transcript (
244239 transcript ,
245- [
246- {"message" : {"role" : "user" , "content" : f"msg { i } " }}
247- for i in range (SAVE_INTERVAL )
248- ],
240+ [{"message" : {"role" : "user" , "content" : f"msg { i } " }} for i in range (SAVE_INTERVAL )],
249241 )
250242 result = _capture_hook_output (
251243 hook_stop ,
@@ -264,10 +256,7 @@ def test_stop_hook_tracks_save_point(tmp_path):
264256 transcript = tmp_path / "t.jsonl"
265257 _write_transcript (
266258 transcript ,
267- [
268- {"message" : {"role" : "user" , "content" : f"msg { i } " }}
269- for i in range (SAVE_INTERVAL )
270- ],
259+ [{"message" : {"role" : "user" , "content" : f"msg { i } " }} for i in range (SAVE_INTERVAL )],
271260 )
272261 data = {
273262 "session_id" : "test" ,
@@ -355,9 +344,7 @@ def test_maybe_auto_ingest_oserror(tmp_path):
355344 mempal_dir .mkdir ()
356345 with patch .dict ("os.environ" , {"MEMPAL_DIR" : str (mempal_dir )}):
357346 with patch ("mempalace.hooks_cli.STATE_DIR" , tmp_path ):
358- with patch (
359- "mempalace.hooks_cli.subprocess.Popen" , side_effect = OSError ("fail" )
360- ):
347+ with patch ("mempalace.hooks_cli.subprocess.Popen" , side_effect = OSError ("fail" )):
361348 _maybe_auto_ingest () # should not raise
362349
363350
@@ -392,10 +379,7 @@ def test_stop_hook_oserror_on_last_save_read(tmp_path):
392379 transcript = tmp_path / "t.jsonl"
393380 _write_transcript (
394381 transcript ,
395- [
396- {"message" : {"role" : "user" , "content" : f"msg { i } " }}
397- for i in range (SAVE_INTERVAL )
398- ],
382+ [{"message" : {"role" : "user" , "content" : f"msg { i } " }} for i in range (SAVE_INTERVAL )],
399383 )
400384 # Write invalid content to last save file
401385 (tmp_path / "test_last_save" ).write_text ("not_a_number" )
@@ -416,10 +400,7 @@ def test_stop_hook_oserror_on_write(tmp_path):
416400 transcript = tmp_path / "t.jsonl"
417401 _write_transcript (
418402 transcript ,
419- [
420- {"message" : {"role" : "user" , "content" : f"msg { i } " }}
421- for i in range (SAVE_INTERVAL )
422- ],
403+ [{"message" : {"role" : "user" , "content" : f"msg { i } " }} for i in range (SAVE_INTERVAL )],
423404 )
424405
425406 def bad_write_text (* args , ** kwargs ):
0 commit comments