Zillion: change test detection for running tests with multiprocessing (#2243)

This commit is contained in:
Doug Hoskisson
2023-10-01 16:13:30 -07:00
committed by GitHub
parent 58b696e986
commit d5d630dcf0
3 changed files with 2 additions and 19 deletions

View File

@@ -2,20 +2,3 @@ import os
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