Skip to content

Commit

Permalink
Zillion: change test detection for running tests with multiprocessing (
Browse files Browse the repository at this point in the history
  • Loading branch information
beauxq authored Oct 1, 2023
1 parent 58b696e commit d5d630d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion worlds/zillion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from BaseClasses import ItemClassification, LocationProgressType, \
MultiWorld, Item, CollectionState, Entrance, Tutorial
from .config import detect_test
from .logic import cs_to_zz_locs
from .region import ZillionLocation, ZillionRegion
from .options import ZillionStartChar, zillion_options, validate
Expand All @@ -25,6 +24,7 @@
from zilliandomizer.logic_components.items import RESCUE, items as zz_items, Item as ZzItem
from zilliandomizer.logic_components.locations import Location as ZzLocation, Req
from zilliandomizer.options import Chars
from zilliandomizer.patch import detect_test

from ..AutoWorld import World, WebWorld

Expand Down
17 changes: 0 additions & 17 deletions worlds/zillion/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,3 @@

base_id = 8675309
zillion_map = os.path.join(os.path.dirname(__file__), "empty-zillion-map-row-col-labels-281.png")


def detect_test() -> bool:
"""
Parts of generation that are in unit tests need the rom.
This is to detect whether we are running unit tests
so we can work around the need for the rom.
"""
import __main__
try:
if "test" in __main__.__file__:
return True
except AttributeError:
# In some environments, __main__ doesn't have __file__
# We'll assume that's not unit tests.
pass
return False
2 changes: 1 addition & 1 deletion worlds/zillion/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zilliandomizer @ git+https://github.com/beauxq/zilliandomizer@4b27d115269db25fe73b0471b73495f41df1323c#0.5.3
zilliandomizer @ git+https://github.com/beauxq/zilliandomizer@d7122bcbeda40da5db26d60fad06246a1331706f#0.5.4

0 comments on commit d5d630d

Please sign in to comment.