MCPcopy
hub / github.com/pallets/werkzeug / test_local_stack

Function test_local_stack

tests/test_local.py:97–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95
96
97def test_local_stack():
98 ls = local.LocalStack(_cv_stack)
99 assert ls.top is None
100 ls.push(42)
101 assert ls.top == 42
102 ls.push(23)
103 assert ls.top == 23
104 ls.pop()
105 assert ls.top == 42
106 ls.pop()
107 assert ls.top is None
108 assert ls.pop() is None
109 assert ls.pop() is None
110
111 proxy = ls()
112 ls.push([1, 2])
113 assert proxy == [1, 2]
114 ls.push((1, 2))
115 assert proxy == (1, 2)
116 ls.pop()
117 ls.pop()
118 assert repr(proxy) == "<LocalProxy unbound>"
119
120
121def test_local_stack_asyncio():

Callers

nothing calls this directly

Calls 2

pushMethod · 0.95
popMethod · 0.95

Tested by

no test coverage detected