Home / Function/ test_deprecated_method() — langchain Function Reference

test_deprecated_method() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2bf0db7c_9919_33a9_f540_574585492b54["test_deprecated_method()"]
  07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1["test_deprecation.py"]
  2bf0db7c_9919_33a9_f540_574585492b54 -->|defined in| 07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1
  751ec235_2cab_e87f_bb57_2a3fa91d5d9d["deprecated_method()"]
  2bf0db7c_9919_33a9_f540_574585492b54 -->|calls| 751ec235_2cab_e87f_bb57_2a3fa91d5d9d
  style 2bf0db7c_9919_33a9_f540_574585492b54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/_api/test_deprecation.py lines 161–178

def test_deprecated_method() -> None:
    """Test deprecated method."""
    with warnings.catch_warnings(record=True) as warning_list:
        warnings.simplefilter("always")
        obj = ClassWithDeprecatedMethods()
        assert obj.deprecated_method() == "This is a deprecated method."
        assert len(warning_list) == 1
        warning = warning_list[0].message
        assert str(warning) == (
            "The method `ClassWithDeprecatedMethods.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")

    assert not inspect.iscoroutinefunction(obj.deprecated_method)

Subdomains

Frequently Asked Questions

What does test_deprecated_method() do?
test_deprecated_method() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/_api/test_deprecation.py.
Where is test_deprecated_method() defined?
test_deprecated_method() is defined in libs/core/tests/unit_tests/_api/test_deprecation.py at line 161.
What does test_deprecated_method() call?
test_deprecated_method() 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