mirror of
https://github.com/kk7ds/chirp.git
synced 2024-09-21 02:27:21 +00:00
b257795c83
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
24 lines
533 B
Python
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)
|