How to use the tempora.timing.Stopwatch function in tempora

To help you get started, we’ve selected a few tempora examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yougov / pmxbot / tests / functional / __init__.py View on Github external
def wait_for_tables(cls, timeout=30):
        watch = tempora.timing.Stopwatch()
        while watch.split() < datetime.timedelta(seconds=timeout):
            try:
                cls.check_logs('#check')
                return
            except Exception:
                # short-circuit if the bot has stopped
                if cls.bot.poll() is not None:
                    return
                time.sleep(0.2)