Skip to content

Commit

Permalink
Minor testing workflow fixes
Browse files Browse the repository at this point in the history
also specify aenum for greater python version coverage
  • Loading branch information
ManicJamie committed Jul 17, 2024
1 parent c6b9506 commit 2ec7231
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ jobs:
LOW_USERNAME: ${{secrets.LOW_USERNAME}}
LOW_PASSWORD: ${{secrets.LOW_PASSWORD}}
SKIP_HEAVY_TESTS: true
SUPPRESS_LOGS: true
run: |
python -m pytest
6 changes: 3 additions & 3 deletions src/speedruncompy/datatypes/enums.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import enum
import aenum
from aenum import extend_enum
from ._impl import _log
from .. import config, exceptions

class StrEnum(enum.StrEnum):
class StrEnum(aenum.StrEnum):
"""WARN: this is a forgiving enum type, which dynamically adds missing fields at runtime."""
@classmethod
def _missing_(cls, value):
Expand All @@ -14,7 +14,7 @@ def _missing_(cls, value):
extend_enum(cls, str(value), (value, ))
return list(cls)[-1] # type: ignore

class IntEnum(enum.IntEnum):
class IntEnum(aenum.IntEnum):
"""WARN: this is a forgiving enum type, which dynamically adds missing fields at runtime."""
@classmethod
def _missing_(cls, value):
Expand Down
5 changes: 1 addition & 4 deletions test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@

logging.getLogger().setLevel(logging.DEBUG)

if "SKIP_HEAVY_TESTS" in os.environ:
SKIP_HEAVY_TESTS = bool(os.environ["SKIP_HEAVY_TESTS"])
else:
SKIP_HEAVY_TESTS = True
SKIP_HEAVY_TESTS = bool(os.environ.get("SKIP_HEAVY_TESTS", True))

game_id = "76rqmld8" # Hollow Knight
category_id = "02q8o4p2" # Any%
Expand Down
12 changes: 8 additions & 4 deletions test/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
LOW_PASSWORD = os.environ.get("LOW_PASSWORD", None)
IS_SUPERMOD = bool(os.environ.get("IS_SUPERMOD", False))

game_id = "76rqmld8" # Hollow Knight
if not os.environ.get("SUPPRESS_LOGS", False):
logging.getLogger().setLevel(logging.DEBUG)
else:
logging.getLogger().setLevel(logging.WARNING)

logging.getLogger().addHandler(logging.FileHandler("testing.log", "w"))

game_id = "76rqmld8" # Hollow Knight
game_url = "hollowknight"
category_id = "02q8o4p2" # Any%
level_category = "wkpq608d" # Hollow Knight "Level" category
Expand All @@ -49,9 +56,6 @@
series_id = "8nw2ygxn" # Shrek Fangames
super_gameId = "pd0nlx21" # ThirdParty_Testing

logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger().addHandler(logging.FileHandler("testing.log", "w"))

# All tests are done with strict type conformance to catch errors early
# In downstream this is default False, and warnings are given instead of errors.
# See `TestDatatypes.test_Missing_Fields_Loose` for behaviour without STRICT.
Expand Down

0 comments on commit 2ec7231

Please sign in to comment.