Home / Function/ test_rename_parameter_for_async_func() — langchain Function Reference

test_rename_parameter_for_async_func() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f3ff054e_94a5_ada4_88cc_03c66818f457["test_rename_parameter_for_async_func()"]
  07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1["test_deprecation.py"]
  f3ff054e_94a5_ada4_88cc_03c66818f457 -->|defined in| 07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1
  style f3ff054e_94a5_ada4_88cc_03c66818f457 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/_api/test_deprecation.py lines 442–463

async def test_rename_parameter_for_async_func() -> None:
    """Test rename parameter."""

    @rename_parameter(since="2.0.0", removal="3.0.0", old="old_name", new="new_name")
    async def foo(new_name: str) -> str:
        """Original doc."""
        return new_name

    with warnings.catch_warnings(record=True) as warning_list:
        warnings.simplefilter("always")
        assert await foo(old_name="hello") == "hello"  # type: ignore[call-arg]
        assert len(warning_list) == 1
        assert await foo(new_name="hello") == "hello"
        assert await foo("hello") == "hello"
        assert foo.__doc__ == "Original doc."
        with pytest.raises(TypeError):
            await foo(meow="hello")  # type: ignore[call-arg]
        with pytest.raises(TypeError):
            assert await foo("hello", old_name="hello")  # type: ignore[call-arg]

        with pytest.raises(TypeError):
            assert await foo(old_name="a", new_name="hello")  # type: ignore[call-arg]

Subdomains

Frequently Asked Questions

What does test_rename_parameter_for_async_func() do?
test_rename_parameter_for_async_func() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/_api/test_deprecation.py.
Where is test_rename_parameter_for_async_func() defined?
test_rename_parameter_for_async_func() is defined in libs/core/tests/unit_tests/_api/test_deprecation.py at line 442.

Analyze Your Own Codebase

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

Try Supermodel Free