@@ -442,16 +442,10 @@ def test_return_all_except_first():
442442 conv .add ("system" , "System" )
443443 conv .add ("user" , "Hello" )
444444 conv .add ("assistant" , "Hi" )
445- try :
446- result = conv .return_all_except_first ()
447- assert len (result ) == 2
448- assert result [0 ]["role" ] == "user"
449- assert result [1 ]["role" ] == "assistant"
450- logger .success ("test_return_all_except_first passed" )
451- return True
452- except AssertionError as e :
453- logger .error (f"test_return_all_except_first failed: { str (e )} " )
454- return False
445+ result = conv .return_all_except_first ()
446+ assert len (result ) == 2
447+ assert result [0 ]["role" ] == "user"
448+ assert result [1 ]["role" ] == "assistant"
455449
456450
457451def test_return_all_except_first_string ():
@@ -460,18 +454,10 @@ def test_return_all_except_first_string():
460454 conv .add ("system" , "System" )
461455 conv .add ("user" , "Hello" )
462456 conv .add ("assistant" , "Hi" )
463- try :
464- result = conv .return_all_except_first_string ()
465- assert "Hello" in result
466- assert "Hi" in result
467- assert "System" not in result
468- logger .success ("test_return_all_except_first_string passed" )
469- return True
470- except AssertionError as e :
471- logger .error (
472- f"test_return_all_except_first_string failed: { str (e )} "
473- )
474- return False
457+ result = conv .return_all_except_first_string ()
458+ assert "Hello" in result
459+ assert "Hi" in result
460+ assert "System" not in result
475461
476462
477463def test_batch_add ():
0 commit comments