Files
lutris/tests/nose2_plugins/ci_exclude_test.py
ItsAllAboutTheCode 900904c4db Added unittest run to the static analysis workflow
Also updated the pre-commit hook to invoke the test as well.

Added a nose2 plugin that skip the Dialog test when running on CI
2026-03-24 10:42:47 -05:00

23 lines
589 B
Python

"""nose2 plugin that skips tests when running with the CI config file"""
import logging
from nose2.events import MatchPathEvent, Plugin
TEST_TO_SKIP = ["_test_dialogs.py"]
log = logging.getLogger("nose2.plugins.ci_exclude_test")
class ExcludeTestCI(Plugin):
configSection = "exclude-ci"
commandLineSwitch = (None, "exclude-ci", "True")
def matchPath(self, event: MatchPathEvent) -> bool:
if event.name in TEST_TO_SKIP:
log.info(f'Skipping test for module "{event.name}')
event.handled = True
return False
return True