blob: 57270f902bf5e3c0dd9a7e56b7cafdf2714e3def (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
"""Test runner and related functions."""
import logging
import Omni.App as App
import Omni.Log as Log
import typing
import unittest
TestCase = unittest.TestCase
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)
|