MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / assertRunUnder

Method assertRunUnder

asyncpg/_testbase/__init__.py:144–154  ·  view source on GitHub ↗
(self, delta)

Source from the content-addressed store, hash-verified

142
143 @contextlib.contextmanager
144 def assertRunUnder(self, delta):
145 st = time.monotonic()
146 try:
147 yield
148 finally:
149 elapsed = time.monotonic() - st
150 if elapsed > delta:
151 raise AssertionError(
152 'running block took {:0.3f}s which is longer '
153 'than the expected maximum of {:0.3f}s'.format(
154 elapsed, delta))
155
156 @contextlib.contextmanager
157 def assertLoopErrorHandlerCalled(self, msg_re: str):

Calls

no outgoing calls