@@ -889,20 +889,18 @@ def test_similarity_without_good_canididates():
889889
890890
891891def test_similarity_overwrite_function ():
892- suggested_command = cu .suggest_similar ("test" , ["history" , "test" ])
892+ options = ["history" , "test" ]
893+ suggested_command = cu .suggest_similar ("test" , options )
893894 assert suggested_command == 'test'
894895
895896 def custom_similarity_function (s1 , s2 ):
896897 return 1.0 if 'history' in (s1 , s2 ) else 0.0
897898
898- suggested_command = cu .suggest_similar ("test" , ["history" , "test" ],
899- similarity_function_to_use = custom_similarity_function )
899+ suggested_command = cu .suggest_similar ("test" , options , similarity_function_to_use = custom_similarity_function )
900900 assert suggested_command == 'history'
901901
902- suggested_command = cu .suggest_similar ("history" , ["history" , "test" ],
903- similarity_function_to_use = custom_similarity_function )
902+ suggested_command = cu .suggest_similar ("history" , options , similarity_function_to_use = custom_similarity_function )
904903 assert suggested_command == 'history'
905904
906- suggested_command = cu .suggest_similar ("test" , ["test" ],
907- similarity_function_to_use = custom_similarity_function )
905+ suggested_command = cu .suggest_similar ("test" , ["test" ], similarity_function_to_use = custom_similarity_function )
908906 assert suggested_command is None
0 commit comments