Files
wehub-resource-sync e4dcfc49aa
Tests / Lint and Format (push) Waiting to run
Tests / Web Node Tests (push) Waiting to run
Tests / Import Check (Python 3.11) (push) Waiting to run
Tests / Import Check (Python 3.12) (push) Waiting to run
Tests / Import Check (Python 3.13) (push) Waiting to run
Tests / Import Check (Python 3.14) (push) Waiting to run
Tests / Python Tests (Python 3.11) (push) Blocked by required conditions
Tests / Python Tests (Python 3.12) (push) Blocked by required conditions
Tests / Python Tests (Python 3.13) (push) Blocked by required conditions
Tests / Python Tests (Python 3.14) (push) Blocked by required conditions
Tests / Test Summary (push) Blocked by required conditions
chore: import upstream snapshot with attribution
2026-07-13 13:00:43 +08:00

18 lines
675 B
Python

from deeptutor.logging import bind_log_context, current_log_context
def test_bind_log_context_is_scoped_and_nested():
assert current_log_context() == {}
with bind_log_context(request_id="req-1", task_id="task-1"):
assert current_log_context() == {"request_id": "req-1", "task_id": "task-1"}
with bind_log_context(stage="indexing", task_id="task-2"):
assert current_log_context() == {
"request_id": "req-1",
"task_id": "task-2",
"stage": "indexing",
}
assert current_log_context() == {"request_id": "req-1", "task_id": "task-1"}
assert current_log_context() == {}