-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.py
executable file
·32 lines (29 loc) · 1.12 KB
/
test.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
# coding=utf8
"""
Run Python test suite via the standard unittest mechanism.
Usage:
python test.py
python test.py --logall
python test.py TestConformTransforms
python test.py -l TestOA.test_process
All logging is suppressed unless --logall or -l specified
~/.openaddr-logging-test.json can also be used to configure log behavior
"""
import unittest
import sys, os
import logging
from openaddr.tests import TestOA, TestState
from openaddr.tests.cache import TestCacheExtensionGuessing, TestCacheEsriDownload
from openaddr.tests.conform import TestConformCli, TestConformTransforms, TestConformMisc, TestConformCsv, TestConformTests
from openaddr.tests.preview import TestPreview
from openaddr.tests.slippymap import TestSlippyMap
from openaddr.tests.util import TestUtilities
if __name__ == '__main__':
# Allow the user to turn on logging with -l or --logall
# unittest.main() has its own command line so we slide this in first
level = logging.CRITICAL
for i, arg in enumerate(sys.argv[1:]):
if arg == "-l" or arg == "--logall":
level = logging.DEBUG
del sys.argv[i]
unittest.main()