def flaky_method(max_runs: int) -> Callable[[TestMethod], TestMethod]:
    """flaky.flaky, but with type annotations."""
    def _decorator(fn: TestMethod) -> TestMethod:
        return cast(TestMethod, flaky.flaky(max_runs)(fn))
    return _decorator
flaky.flaky, but with type annotations.
tests/helpers.py