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

Function test_context_manager_anonymous

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

Test that anonymous Timer works with context manager.

()

Source from the content-addressed store, hash-verified

58
59
60def test_context_manager_anonymous():
61 """Test that anonymous Timer works with context manager."""
62 timer = common.Timer()
63 with timer:
64 sleep(0.05)
65 assert timer.elapsed().total_seconds() > 0.045
66
67
68if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

elapsedMethod · 0.95
TimerMethod · 0.80

Tested by

no test coverage detected