blob: 89ef1fa5ac2986f57e969384a601fbd0d3ee93f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
"""Test runner and related functions."""
import logging
import Omni.App as App
import Omni.Log as Log
import typing
import unittest
TestCase = unittest.TestCase
class TestError(Exception):
"""When the test environment or harness encounters a problem."""
def run(area: App.Area, tests: list[typing.Any]) -> None:
"""Run the given tests with loglevel determined by area."""
Log.setup(logging.DEBUG if area == App.Area.Test else logging.ERROR)
suite = unittest.TestSuite()
suite.addTests([
unittest.defaultTestLoader.loadTestsFromTestCase(tc) for tc in tests
])
unittest.TextTestRunner(verbosity=2).run(suite)
|