-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_all.py
33 lines (24 loc) · 965 Bytes
/
test_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Runs all the tests in the tests module or sub-package of the main package."""
# Copyright 2022-2023 Yucheng Liu. GNU LGPL3 license.
# GNU LGPL3 license copy: https://www.gnu.org/licenses/lgpl-3.0.txt
# GNU LGPL3 is based on GNU GPL3, GNU GPL3 copy: https://www.gnu.org/licenses/gpl-3.0.txt
# First added by username: liu-yucheng
# Last updated by username: liu-yucheng
import pathlib
import unittest
from os import path as ospath
_join = ospath.join
_Path = pathlib.Path
_TestLoader = unittest.TestLoader
_TextTestRunner = unittest.TextTestRunner
_repo_path = str(_Path(__file__).parent)
_main_package_path = _join(_repo_path, "lyc_pyutils")
_tests_path = _join(_main_package_path, "tests")
def main():
"""Runs this module as an executable."""
loader = _TestLoader()
suite = loader.discover(start_dir=_tests_path, pattern="test*.py")
runner = _TextTestRunner(verbosity=1)
runner.run(test=suite)
if __name__ == "__main__":
main()