test_secret_from_env_with_none_default() — langchain Function Reference
Architecture documentation for the test_secret_from_env_with_none_default() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 9f7cbe4c_3c3c_aec8_f5b7_fdd7d4ed6d11["test_secret_from_env_with_none_default()"] 76328b48_c466_d255_3e8f_a315858c4c02["test_utils.py"] 9f7cbe4c_3c3c_aec8_f5b7_fdd7d4ed6d11 -->|defined in| 76328b48_c466_d255_3e8f_a315858c4c02 style 9f7cbe4c_3c3c_aec8_f5b7_fdd7d4ed6d11 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/utils/test_utils.py lines 303–313
def test_secret_from_env_with_none_default(monkeypatch: pytest.MonkeyPatch) -> None:
# Unset the environment variable
monkeypatch.delenv("TEST_KEY", raising=False)
# Get the function with a default value of None
get_secret: Callable[[], SecretStr | None] = secret_from_env(
"TEST_KEY", default=None
)
# Assert that it returns None
assert get_secret() is None
Domain
Subdomains
Source
Frequently Asked Questions
What does test_secret_from_env_with_none_default() do?
test_secret_from_env_with_none_default() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/utils/test_utils.py.
Where is test_secret_from_env_with_none_default() defined?
test_secret_from_env_with_none_default() is defined in libs/core/tests/unit_tests/utils/test_utils.py at line 303.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free