示例#1
0
文件: test_ctx.py 项目: tharvik/quart
def test_app_ctx_globals_pop() -> None:
    g = _AppCtxGlobals()
    g.foo = 'bar'  # type: ignore
    assert g.pop('foo') == 'bar'
    assert g.pop('foo', None) is None
    with pytest.raises(KeyError):
        g.pop('foo')
示例#2
0
def test_app_ctx_globals_pop() -> None:
    g = _AppCtxGlobals()
    g.foo = "bar"  # type: ignore
    assert g.pop("foo") == "bar"
    assert g.pop("foo", None) is None
    with pytest.raises(KeyError):
        g.pop("foo")