From 66a1e3f083fbd686e935e070ac961fc88cd6c668 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 3 May 2024 11:55:46 -0400 Subject: [PATCH] langchain[patch]: Fix flaky unit test (#21258) Should sort the results of the import test since it depends on import order --- .../unit_tests/load/test_serializable.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libs/langchain/tests/unit_tests/load/test_serializable.py b/libs/langchain/tests/unit_tests/load/test_serializable.py index ea21e709ac..613e3f01d8 100644 --- a/libs/langchain/tests/unit_tests/load/test_serializable.py +++ b/libs/langchain/tests/unit_tests/load/test_serializable.py @@ -64,15 +64,17 @@ def test_import_all_modules() -> None: ] # This test will need to be updated if new serializable classes are added # to community - assert filtered_modules == [ - ("langchain", "chat_models", "azure_openai", "AzureChatOpenAI"), - ("langchain", "chat_models", "bedrock", "BedrockChat"), - ("langchain", "chat_models", "anthropic", "ChatAnthropic"), - ("langchain", "chat_models", "fireworks", "ChatFireworks"), - ("langchain", "chat_models", "google_palm", "ChatGooglePalm"), - ("langchain", "chat_models", "openai", "ChatOpenAI"), - ("langchain", "chat_models", "vertexai", "ChatVertexAI"), - ] + assert sorted(filtered_modules) == sorted( + [ + ("langchain", "chat_models", "azure_openai", "AzureChatOpenAI"), + ("langchain", "chat_models", "bedrock", "BedrockChat"), + ("langchain", "chat_models", "anthropic", "ChatAnthropic"), + ("langchain", "chat_models", "fireworks", "ChatFireworks"), + ("langchain", "chat_models", "google_palm", "ChatGooglePalm"), + ("langchain", "chat_models", "openai", "ChatOpenAI"), + ("langchain", "chat_models", "vertexai", "ChatVertexAI"), + ] + ) def test_serializable_mapping() -> None: