-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.py
More file actions
30 lines (27 loc) · 862 Bytes
/
run_tests.py
File metadata and controls
30 lines (27 loc) · 862 Bytes
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
from tests import (
test_parser,
test_reader,
test_quote_parser,
test_chart_parser,
test_user_config_parser,
test_quote_displayer,
test_displayer,
test_trends_displayer
)
import unittest
from types import ModuleType
def instantiate_test(module_name: ModuleType) -> None:
"""
load tests from the passed module and run them.
:param module_name -> ``str``: the name of a module that contains python unit tests.
"""
MODULE = unittest.TestLoader().loadTestsFromModule(module_name)
unittest.TextTestRunner().run(MODULE)
instantiate_test(test_reader)
instantiate_test(test_parser)
instantiate_test(test_quote_parser)
instantiate_test(test_chart_parser)
instantiate_test(test_user_config_parser)
instantiate_test(test_quote_displayer)
instantiate_test(test_displayer)
instantiate_test(test_trends_displayer)