From a4c7d933a9230da2a32a9be97bf8760a14a928bd Mon Sep 17 00:00:00 2001 From: CyanideByte Date: Sat, 27 Apr 2024 15:44:40 -0700 Subject: [PATCH] Added pytest for pydantic protected namespace warning --- litellm/tests/test_pydantic_namespaces.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 litellm/tests/test_pydantic_namespaces.py diff --git a/litellm/tests/test_pydantic_namespaces.py b/litellm/tests/test_pydantic_namespaces.py new file mode 100644 index 00000000000..8314216e1a5 --- /dev/null +++ b/litellm/tests/test_pydantic_namespaces.py @@ -0,0 +1,10 @@ +import warnings +import pytest + +def test_namespace_conflict_warning(): + with warnings.catch_warnings(record=True) as recorded_warnings: + warnings.simplefilter("always") # Capture all warnings + import litellm + + # Check that no warning with the specific message was raised + assert not any("conflict with protected namespace" in str(w.message) for w in recorded_warnings), "Test failed: 'conflict with protected namespace' warning was encountered!"