diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index d24c55b49ac2..1a76a7f47160 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -54,9 +54,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-subtests + pip install pytest pytest-subtests pytest-xdist python ModuleUpdate.py --yes --force --append "WebHostLib/requirements.txt" python Launcher.py --update_settings # make sure host.yaml exists for tests - name: Unittests run: | - pytest + pytest -n auto diff --git a/test/TestBase.py b/test/TestBase.py index 856428fb57ed..4df6b8076913 100644 --- a/test/TestBase.py +++ b/test/TestBase.py @@ -1,16 +1,11 @@ -import pathlib import typing import unittest from argparse import Namespace -import Utils from test.general import gen_steps from worlds import AutoWorld from worlds.AutoWorld import call_all -file_path = pathlib.Path(__file__).parent.parent -Utils.local_path.cached_path = file_path - from BaseClasses import MultiWorld, CollectionState, ItemClassification, Item from worlds.alttp.Items import ItemFactory diff --git a/test/__init__.py b/test/__init__.py index 32622f65a927..03716a10d7ec 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,3 +1,4 @@ +import pathlib import warnings import settings @@ -5,3 +6,12 @@ warnings.simplefilter("always") settings.no_gui = True settings.skip_autosave = True + +import ModuleUpdate + +ModuleUpdate.update_ran = True # don't upgrade + +import Utils + +Utils.local_path.cached_path = pathlib.Path(__file__).parent.parent +Utils.user_path() # initialize cached_path diff --git a/test/programs/TestGenerate.py b/test/programs/TestGenerate.py index d04e1f2c5bf4..73e1d3b8348c 100644 --- a/test/programs/TestGenerate.py +++ b/test/programs/TestGenerate.py @@ -1,13 +1,13 @@ # Tests for Generate.py (ArchipelagoGenerate.exe) import unittest +import os +import os.path import sys + from pathlib import Path from tempfile import TemporaryDirectory -import os.path -import os -import ModuleUpdate -ModuleUpdate.update_ran = True # don't upgrade + import Generate