示例#1
0
def test_del_unset_context():
    with pytest.raises(ctx.ContextError):
        ctx.del_context(ctx.ProxyContext)
示例#2
0
def test_use_context(context):
    with ctx.use_context(context):
        assert ctx.get_proxy_context() == context
    with pytest.raises(ctx.ContextError):
        ctx.del_context(ctx.ProxyContext)
示例#3
0
def test_get_set_context_ok(context):
    ctx.set_context(context)
    try:
        assert ctx.get_proxy_context() == context
    finally:
        ctx.del_context(ctx.ProxyContext)