chirp/tests/test_drivers.py
Dan Smith b257795c83 Add warnings and volatile flag to settings
This adds two functions for settings. A warning message can be added,
which will either always be displayed to the user when they change the
value, or only when they change it away from some default. They are
given the opportunity to cancel the change if the warning makes them
reconsider.

Also, a setting can be marked "volatile" which will cause the settings
tab to be fully reloaded when it has been changed. This resets the
view as well, so it's not ideal, but this can be used when one setting
necessarily impacts another.

Fixes #10695
2023-07-02 20:33:50 -07:00

24 lines
533 B
Python

from chirp import directory
from tests import load_tests
__builtins__['_'] = lambda s: s
class TestSuiteAdapter(object):
"""Adapter for pytest since it doesn't support the loadTests() protocol"""
def __init__(self, locals):
self.locals = locals
def loadTestsFromTestCase(self, test_cls):
self.locals[test_cls.__name__] = test_cls
@staticmethod
def addTests(tests):
pass
directory.import_drivers()
adapter = TestSuiteAdapter(locals())
load_tests(adapter, None, None, suite=adapter)