Home / Function/ test_deprecated_method_pydantic() — langchain Function Reference

test_deprecated_method_pydantic() — langchain Function Reference

Architecture documentation for the test_deprecated_method_pydantic() function in test_deprecation.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  72d54fbd_09f2_4f8c_bc88_c9b497fe3f2b["test_deprecated_method_pydantic()"]
  07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1["test_deprecation.py"]
  72d54fbd_09f2_4f8c_bc88_c9b497fe3f2b -->|defined in| 07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1
  b076f2d0_d292_f547_2081_ee248d4e87a9["deprecated_method()"]
  72d54fbd_09f2_4f8c_bc88_c9b497fe3f2b -->|calls| b076f2d0_d292_f547_2081_ee248d4e87a9
  style 72d54fbd_09f2_4f8c_bc88_c9b497fe3f2b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/_api/test_deprecation.py lines 386–401

def test_deprecated_method_pydantic() -> None:
    """Test deprecated method."""
    with warnings.catch_warnings(record=True) as warning_list:
        warnings.simplefilter("always")
        obj = MyModel()
        assert obj.deprecated_method() == "This is a deprecated method."
        assert len(warning_list) == 1
        warning = warning_list[0].message
        assert str(warning) == (
            "The method `MyModel.deprecated_method` was deprecated in "
            "tests 2.0.0 and will be removed in 3.0.0"
        )

        doc = obj.deprecated_method.__doc__
        assert isinstance(doc, str)
        assert doc.startswith("!!! deprecated")

Subdomains

Frequently Asked Questions

What does test_deprecated_method_pydantic() do?
test_deprecated_method_pydantic() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/_api/test_deprecation.py.
Where is test_deprecated_method_pydantic() defined?
test_deprecated_method_pydantic() is defined in libs/core/tests/unit_tests/_api/test_deprecation.py at line 386.
What does test_deprecated_method_pydantic() call?
test_deprecated_method_pydantic() calls 1 function(s): deprecated_method.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free