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

Function test_proxy_context_manager

tests/test_local.py:467–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

465
466
467def test_proxy_context_manager():
468 class Example:
469 value = 2
470
471 def __enter__(self):
472 self.value += 1
473 return self
474
475 def __exit__(self, exc_type, exc_val, exc_tb):
476 self.value -= 1
477
478 _, p = _make_proxy(Example())
479 assert p.value == 2
480
481 with p:
482 assert p.value == 3
483
484 assert p.value == 2
485
486
487def test_proxy_class():

Callers

nothing calls this directly

Calls 2

_make_proxyFunction · 0.85
ExampleClass · 0.85

Tested by

no test coverage detected