MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / skip_if_timeout

Function skip_if_timeout

lib/sqlalchemy/testing/util.py:564–575  ·  view source on GitHub ↗
(seconds: float, cleanup: Any = None)

Source from the content-addressed store, hash-verified

562
563@contextlib.contextmanager
564def skip_if_timeout(seconds: float, cleanup: Any = None):
565
566 now = time.time()
567 yield
568 sec = time.time() - now
569 if sec > seconds:
570 try:
571 cleanup()
572 finally:
573 config.skip_test(
574 f"test took too long ({sec:.4f} seconds > {seconds})"
575 )

Callers

nothing calls this directly

Calls 2

skip_testMethod · 0.80
timeMethod · 0.45

Tested by

no test coverage detected