test_verbose_is_settable_via_setter() — langchain Function Reference
Architecture documentation for the test_verbose_is_settable_via_setter() function in test_globals.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 24d9f718_b695_1318_faf0_1bb7efff8919["test_verbose_is_settable_via_setter()"] d15e95c4_3344_c8ce_47d5_14e082f95cb5["test_globals.py"] 24d9f718_b695_1318_faf0_1bb7efff8919 -->|defined in| d15e95c4_3344_c8ce_47d5_14e082f95cb5 style 24d9f718_b695_1318_faf0_1bb7efff8919 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/test_globals.py lines 55–83
def test_verbose_is_settable_via_setter() -> None:
from langchain_core import globals as langchain_globals
from langchain_classic.chains.base import _get_verbosity
previous_value = langchain_globals._verbose
previous_fn_reading = _get_verbosity()
assert previous_value == previous_fn_reading
# Flip the value of the flag.
set_verbose(not previous_value)
new_value = langchain_globals._verbose
new_fn_reading = _get_verbosity()
try:
# We successfully changed the value of `verbose`.
assert new_value != previous_value
# If we access `verbose` via a function used elsewhere in langchain,
# it also sees the same new value.
assert new_value == new_fn_reading
# If we access `verbose` via `get_verbose()` we also get the same value.
assert new_value == get_verbose()
finally:
# Make sure we don't alter global state, even if the test fails.
# Always reset `verbose` to the value it had before.
set_verbose(previous_value)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_verbose_is_settable_via_setter() do?
test_verbose_is_settable_via_setter() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/test_globals.py.
Where is test_verbose_is_settable_via_setter() defined?
test_verbose_is_settable_via_setter() is defined in libs/langchain/tests/unit_tests/test_globals.py at line 55.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free