File: test_drivers.py

package info (click to toggle)
chirp 1%3A20251108-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,728 kB
  • sloc: python: 156,369; ansic: 296; sh: 219; xml: 24; makefile: 19
file content (23 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)