mirror of
https://github.com/hwchase17/langchain.git
synced 2026-07-15 07:00:38 +00:00
Apply patch [skip ci]
This commit is contained in:
@@ -174,13 +174,10 @@ def test_set_config_context_reuse_raises_error() -> None:
|
||||
assert ctx1 is not None
|
||||
|
||||
# Second enter should raise RuntimeError
|
||||
with pytest.raises(RuntimeError) as exc_info:
|
||||
with ctx_manager: # noqa: SIM117
|
||||
pass # Should not reach here
|
||||
|
||||
assert "Cannot re-enter an already-entered context manager" in str(
|
||||
exc_info.value
|
||||
)
|
||||
with pytest.raises(
|
||||
RuntimeError, match="Cannot re-enter an already-entered context manager"
|
||||
):
|
||||
ctx_manager.__enter__()
|
||||
|
||||
|
||||
def test_set_config_context_exit_without_enter() -> None:
|
||||
@@ -239,3 +236,4 @@ def test_set_config_context_nested_different_instances() -> None:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user