aboutsummaryrefslogtreecommitdiff
path: root/tests/managers/thl/test_contest
diff options
context:
space:
mode:
authorMax Nanis2026-09-01 10:43:29 -0700
committerMax Nanis2026-09-01 10:43:29 -0700
commit89ed44f466dc9a93d6f85931fb6eea0e9cbd27f6 (patch)
tree8bcce59aa74271e38f056c954ee3e8457dae241a /tests/managers/thl/test_contest
parentd19438ec4ccbbe4415c286c9ae89e3e5706ac553 (diff)
downloadgeneralresearch-89ed44f466dc9a93d6f85931fb6eea0e9cbd27f6.tar.gz
generalresearch-89ed44f466dc9a93d6f85931fb6eea0e9cbd27f6.zip
working through circular imports, removing __init__ loaded Types / Definitions
Diffstat (limited to 'tests/managers/thl/test_contest')
-rw-r--r--tests/managers/thl/test_contest/test_leaderboard.py19
-rw-r--r--tests/managers/thl/test_contest/test_milestone.py20
-rw-r--r--tests/managers/thl/test_contest/test_raffle.py21
3 files changed, 37 insertions, 23 deletions
diff --git a/tests/managers/thl/test_contest/test_leaderboard.py b/tests/managers/thl/test_contest/test_leaderboard.py
index 3a63075..d80d512 100644
--- a/tests/managers/thl/test_contest/test_leaderboard.py
+++ b/tests/managers/thl/test_contest/test_leaderboard.py
@@ -1,23 +1,28 @@
from __future__ import annotations
from datetime import UTC, datetime, timedelta
+from typing import TYPE_CHECKING
from zoneinfo import ZoneInfo
from generalresearch.currency import USDCent
-from generalresearch.managers.thl.contest_manager import ContestManager
-from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
-from generalresearch.managers.thl.user_manager.user_manager import UserManager
from generalresearch.models.thl.contest.definitions import (
ContestEndReason,
ContestStatus,
)
from generalresearch.models.thl.contest.leaderboard import (
LeaderboardContest,
- LeaderboardContestCreate,
)
-from generalresearch.models.thl.product import Product
-from generalresearch.models.thl.user import User
-from generalresearch.redis_helper import RedisConfig
+
+if TYPE_CHECKING:
+ from generalresearch.managers.thl.contest_manager import ContestManager
+ from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
+ from generalresearch.managers.thl.user_manager.user_manager import UserManager
+ from generalresearch.models.thl.contest.leaderboard import (
+ LeaderboardContestCreate,
+ )
+ from generalresearch.models.thl.product import Product
+ from generalresearch.models.thl.user import User
+ from generalresearch.redis_helper import RedisConfig
class TestLeaderboardContestCRUD:
diff --git a/tests/managers/thl/test_contest/test_milestone.py b/tests/managers/thl/test_contest/test_milestone.py
index e29ba4c..dbb2016 100644
--- a/tests/managers/thl/test_contest/test_milestone.py
+++ b/tests/managers/thl/test_contest/test_milestone.py
@@ -2,9 +2,8 @@ from __future__ import annotations
from collections.abc import Callable
from datetime import UTC, datetime
+from typing import TYPE_CHECKING
-from generalresearch.managers.thl.contest_manager import ContestManager
-from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
from generalresearch.models.thl.contest.definitions import (
ContestEndReason,
ContestStatus,
@@ -12,12 +11,18 @@ from generalresearch.models.thl.contest.definitions import (
from generalresearch.models.thl.contest.milestone import (
ContestEntryTrigger,
MilestoneContest,
- MilestoneContestCreate,
MilestoneUserView,
)
-from generalresearch.models.thl.contest.raffle import RaffleContest
-from generalresearch.models.thl.product import Product
-from generalresearch.models.thl.user import User
+
+if TYPE_CHECKING:
+ from generalresearch.managers.thl.contest_manager import ContestManager
+ from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
+ from generalresearch.models.thl.contest.milestone import (
+ MilestoneContestCreate,
+ )
+ from generalresearch.models.thl.contest.raffle import RaffleContest
+ from generalresearch.models.thl.product import Product
+ from generalresearch.models.thl.user import User
class TestMilestoneContest:
@@ -25,8 +30,6 @@ class TestMilestoneContest:
def test_should_end(
self,
contest: MilestoneContest,
- thl_ledger_manager: ThlLedgerManager,
- contest_manager: ContestManager,
):
# contest is active and has no entries
should, msg = contest.should_end()
@@ -53,7 +56,6 @@ class TestMilestoneContestCRUD:
self,
contest_create: MilestoneContestCreate,
product_user_wallet_yes: Product,
- thl_ledger_manager: ThlLedgerManager,
contest_manager: ContestManager,
):
c = contest_manager.create(
diff --git a/tests/managers/thl/test_contest/test_raffle.py b/tests/managers/thl/test_contest/test_raffle.py
index 06d4676..7803952 100644
--- a/tests/managers/thl/test_contest/test_raffle.py
+++ b/tests/managers/thl/test_contest/test_raffle.py
@@ -2,19 +2,17 @@ from __future__ import annotations
from collections.abc import Callable
from datetime import UTC, datetime
+from typing import TYPE_CHECKING
import pytest
from pydantic import ValidationError
from pytest import approx
from generalresearch.currency import USDCent
-from generalresearch.managers.thl.contest_manager import ContestManager
from generalresearch.managers.thl.ledger_manager.exceptions import (
LedgerTransactionConditionFailedError,
)
-from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
from generalresearch.models.thl.contest import (
- Contest,
ContestEndCondition,
ContestEntryRule,
ContestPrize,
@@ -29,11 +27,20 @@ from generalresearch.models.thl.contest.raffle import (
ContestEntry,
ContestEntryType,
RaffleContest,
- RaffleContestCreate,
- RaffleUserView,
)
-from generalresearch.models.thl.product import Product
-from generalresearch.models.thl.user import User
+
+if TYPE_CHECKING:
+ from generalresearch.managers.thl.contest_manager import ContestManager
+ from generalresearch.managers.thl.ledger_manager.thl_ledger import ThlLedgerManager
+ from generalresearch.models.thl.contest import (
+ Contest,
+ )
+ from generalresearch.models.thl.contest.raffle import (
+ RaffleContestCreate,
+ RaffleUserView,
+ )
+ from generalresearch.models.thl.product import Product
+ from generalresearch.models.thl.user import User
class TestRaffleContest: