示例#1
0
def test_logging_context_ctx():
    Context.new()
    with logs.logging_context(a=1):
        assert logs.logging_context.flat == {'a': 1}
        with logs.logging_context(a=2):
            assert logs.logging_context.flat == {'a': 2}
        assert logs.logging_context.flat == {'a': 1}
示例#2
0
def context(id):
    with logging_context(request_id=id):
        yield
示例#3
0
def context(id):
    with logging_context(request_id=id):
        yield
示例#4
0
def test_logging_context_ctx():
    with logs.logging_context(a=1):
        assert logs.logging_context.flat == {'a': 1}
        with logs.logging_context(a=2):
            assert logs.logging_context.flat == {'a': 2}
        assert logs.logging_context.flat == {'a': 1}