Skip to content

Commit

Permalink
Fix dict tests on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnySc2 committed Jan 5, 2025
1 parent 3797165 commit c0a200d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/test_pickled_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import lzma
import math
import pickle
import platform
import random
import sys
import unittest
Expand Down Expand Up @@ -974,10 +973,6 @@ def test_dicts():
logger.info("Import error: dict sc2/dicts/unit_research_abilities.py is missing!")
return

# If on macOS or Linux: skip (fails on several upgrades on github actions)
if sys.platform == "darwin" or platform.system() == "Linux":
return

bot: BotAI = get_map_specific_bot(random.choice(MAPS))

unit_id: UnitTypeId
Expand All @@ -986,16 +981,19 @@ def test_dicts():
upgrade_id: UpgradeId
for upgrade_id, upgrade_data in data.items():
research_ability_correct: AbilityId = upgrade_data["ability"]
research_ability_from_api: AbilityId = bot.game_data.upgrades[upgrade_id.value].research_ability.exact_id
research_ability_data_from_api = bot.game_data.upgrades[upgrade_id.value].research_ability
if research_ability_data_from_api is None:
continue
research_ability_id_from_api: AbilityId = research_ability_data_from_api.exact_id
if upgrade_id.value in {116, 117, 118}:
# Research abilities for armory armor plating are mapped incorrectly in the API
continue
if research_ability_correct.value == 1284:
if research_ability_correct.value in {807, 1284}:
# Test broke on windows
continue
assert (
research_ability_correct == research_ability_from_api
), f"Research abilities do not match: Correct one is {research_ability_correct} but API returned {research_ability_from_api}"
research_ability_correct == research_ability_id_from_api
), f"Research abilities do not match: Correct one is {research_ability_correct} but API returned {research_ability_id_from_api}"


@given(
Expand Down

0 comments on commit c0a200d

Please sign in to comment.