mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-07-18 22:00:45 -07:00
Unittests: allow running unittests for specific worlds when using unittest runner (#6338)
This commit is contained in:
+2
-2
@@ -80,10 +80,10 @@ class WorldSource:
|
||||
def name(self) -> str:
|
||||
return Path(self.path).stem
|
||||
|
||||
# AP_TEST_WORLDS (pytest only) scopes auto-loading to the named worlds; these are always loaded for the
|
||||
# AP_TEST_WORLDS scopes auto-loading to the named worlds; these are always loaded for the
|
||||
# suite's fixtures but aren't themselves worlds under test.
|
||||
_SUITE_FIXTURE_WORLDS = {"generic", "apquest"}
|
||||
_test_worlds_env = os.environ.get("AP_TEST_WORLDS") if "pytest" in sys.modules else None
|
||||
_test_worlds_env = os.environ.get("AP_TEST_WORLDS") if "pytest" in sys.modules or "unittest" in sys.modules else None
|
||||
_requested_worlds = {name.strip() for name in _test_worlds_env.split(",") if name.strip()} if _test_worlds_env else None
|
||||
test_worlds_filter = _requested_worlds | _SUITE_FIXTURE_WORLDS if _requested_worlds else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user