test_rename_parameter() — langchain Function Reference
Architecture documentation for the test_rename_parameter() function in test_deprecation.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6b4b6afa_1291_6693_abae_95218b29d101["test_rename_parameter()"] 07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1["test_deprecation.py"] 6b4b6afa_1291_6693_abae_95218b29d101 -->|defined in| 07400ddb_6f57_2ca9_d2d9_e7c7fd98cfc1 style 6b4b6afa_1291_6693_abae_95218b29d101 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/_api/test_deprecation.py lines 417–439
def test_rename_parameter() -> None:
"""Test rename parameter."""
@rename_parameter(since="2.0.0", removal="3.0.0", old="old_name", new="new_name")
def foo(new_name: str) -> str:
"""Original doc."""
return new_name
with warnings.catch_warnings(record=True) as warning_list:
warnings.simplefilter("always")
assert foo(old_name="hello") == "hello" # type: ignore[call-arg]
assert len(warning_list) == 1
assert foo(new_name="hello") == "hello"
assert foo("hello") == "hello"
assert foo.__doc__ == "Original doc."
with pytest.raises(TypeError):
foo(meow="hello") # type: ignore[call-arg]
with pytest.raises(TypeError):
assert foo("hello", old_name="hello") # type: ignore[call-arg]
with pytest.raises(TypeError):
assert foo(old_name="goodbye", new_name="hello") # type: ignore[call-arg]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_rename_parameter() do?
test_rename_parameter() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/_api/test_deprecation.py.
Where is test_rename_parameter() defined?
test_rename_parameter() is defined in libs/core/tests/unit_tests/_api/test_deprecation.py at line 417.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free