From aad980a3a2e5c65f699f928ae801c192ab796cc2 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sat, 28 Feb 2026 19:19:27 +0100 Subject: [PATCH] Test, MultiServer: reorder imports Hopefully this fixes the random test failures with pytest-xdist --- apmw/multiserver/gamespackage/cache.py | 2 +- apmw/webhost/customserver/gamespackage/cache.py | 3 ++- test/webhost/customserver/test_gamespackage_cache.py | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apmw/multiserver/gamespackage/cache.py b/apmw/multiserver/gamespackage/cache.py index 373acadea6..c90200c744 100644 --- a/apmw/multiserver/gamespackage/cache.py +++ b/apmw/multiserver/gamespackage/cache.py @@ -1,7 +1,7 @@ import typing as t from weakref import WeakValueDictionary -from NetUtils import GamesPackage, DataPackage +from NetUtils import GamesPackage GameAndChecksum = tuple[str, str | None] ItemNameGroups = dict[str, list[str]] diff --git a/apmw/webhost/customserver/gamespackage/cache.py b/apmw/webhost/customserver/gamespackage/cache.py index dcb11c5cbf..3224ae649c 100644 --- a/apmw/webhost/customserver/gamespackage/cache.py +++ b/apmw/webhost/customserver/gamespackage/cache.py @@ -1,8 +1,9 @@ from NetUtils import GamesPackage from Utils import restricted_loads -from WebHostLib.models import GameDataPackage from apmw.multiserver.gamespackage.cache import GamesPackageCache, ItemNameGroups, LocationNameGroups +from WebHostLib.models import GameDataPackage + class DBGamesPackageCache(GamesPackageCache): _static: dict[str, tuple[GamesPackage, ItemNameGroups, LocationNameGroups]] diff --git a/test/webhost/customserver/test_gamespackage_cache.py b/test/webhost/customserver/test_gamespackage_cache.py index 01c99e3c69..16f74791f8 100644 --- a/test/webhost/customserver/test_gamespackage_cache.py +++ b/test/webhost/customserver/test_gamespackage_cache.py @@ -1,12 +1,14 @@ import typing as t from copy import deepcopy -import Utils -import apmw.webhost.customserver.gamespackage.cache -from NetUtils import GamesPackage -from apmw.webhost.customserver.gamespackage.cache import DBGamesPackageCache from test.multiserver.test_gamespackage_cache import GamesPackageCacheTest +import Utils +from NetUtils import GamesPackage + +import apmw.webhost.customserver.gamespackage.cache +from apmw.webhost.customserver.gamespackage.cache import DBGamesPackageCache + class FakeGameDataPackage: _rows: "t.ClassVar[dict[str, FakeGameDataPackage]]" = {}