def METHOD_NAME(testdir, cli, schema_url):
    module = testdir.make_importable_pyfile(
        hook=f"""
    import schemathesis
    import time
    TOKEN = "{TOKEN}"
    @schemathesis.auth()
    class TokenAuth:
        def __init__(self):
            self.get_calls = 0
        def get(self, context):
            self.get_calls += 1
            time.sleep(0.05)
            return TOKEN
        def set(self, case, data, context):
            case.headers = {{"Authorization": f"Bearer {{data}}"}}
    @schemathesis.hook
    def after_call(context, case, response):
        provider = schemathesis.auths.GLOBAL_AUTH_STORAGE.providers[0].provider
        assert provider.get_calls == 1, provider.get_calls
    """
    )
    result = cli.main(
        "run",
        schema_url,
        "--workers",
        "2",
        "--hypothesis-max-examples=1",
        "--show-errors-tracebacks",
        hooks=module.purebasename,
    )
    # Then CLI should run successfully
    assert result.exit_code == ExitCode.OK, result.stdout