Skip to content

Commit

Permalink
fix: import + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainmouquet committed Sep 24, 2024
1 parent 1e37038 commit fec99ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions reattempt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__version__ = "1.0.7"
__all__ = ["reattempt"]
__all__ = ("__version__", "reattempt")

import asyncio
import contextlib
Expand All @@ -17,9 +17,6 @@
logger.addHandler(logging.NullHandler())


def __call__(func, max_retries=CONST_DEFAULT_MAX_RETRIES, min_time=CONST_DEFAULT_MIN_TIME, max_time=CONST_DEFAULT_MAX_TIME):
return reattempt(func, max_retries, min_time, max_time)

def reattempt(
func=None,
max_retries: int = CONST_DEFAULT_MAX_RETRIES,
Expand Down Expand Up @@ -199,5 +196,3 @@ async def retry_async_gen_func(*args, **kwargs):
return decorator(func)
return decorator

import sys
sys.modules[__name__] = reattempt
2 changes: 1 addition & 1 deletion test/test_reattempt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import AsyncGenerator

import pytest
import reattempt
from reattempt import reattempt
from test.conftest import MAX_ATTEMPTS, MIN_TIME, MAX_TIME, RetryException


Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fec99ee

Please sign in to comment.