MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / test_context_manager_named

Function test_context_manager_named

python/test/unit/common/test_timer.py:51–57  ·  view source on GitHub ↗

Test that named Timer works as context manager.

()

Source from the content-addressed store, hash-verified

49
50
51def test_context_manager_named():
52 """Test that named Timer works as context manager."""
53 task = "test_context_manager_named_str"
54 with common.Timer(task):
55 sleep(0.05)
56 delta = common.timing(task)
57 assert delta[1].total_seconds() > 0.045
58
59
60def test_context_manager_anonymous():

Callers

nothing calls this directly

Calls 2

TimerMethod · 0.80
timingMethod · 0.45

Tested by

no test coverage detected