Exemple #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}
Exemple #2
0
def context(id):
    with logging_context(request_id=id):
        yield
Exemple #3
0
def context(id):
    with logging_context(request_id=id):
        yield
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}