()
| 119 | |
| 120 | |
| 121 | def test_local_stack_asyncio(): |
| 122 | ls = local.LocalStack(_cv_stack) |
| 123 | ls.push(1) |
| 124 | |
| 125 | async def task(): |
| 126 | ls.push(1) |
| 127 | assert len(ls._storage.get()) == 2 |
| 128 | |
| 129 | async def main(): |
| 130 | futures = [asyncio.ensure_future(task()) for _ in range(3)] |
| 131 | await asyncio.gather(*futures) |
| 132 | |
| 133 | asyncio.run(main()) |
| 134 | |
| 135 | |
| 136 | def test_proxy_local(): |