summaryrefslogtreecommitdiff
path: root/run_integration_tests.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-04 19:14:23 +0100
committermathieui <mathieui@mathieui.net>2021-02-04 19:14:23 +0100
commit40196aefeb2601d1fd4ea2dffe183bce38f6f139 (patch)
tree87854d215cea8f7ef86af94f3e6a45ba3e680b7b /run_integration_tests.py
parentc486c0e8219da4cdea6988b2948ffc93cb381bec (diff)
downloadslixmpp-40196aefeb2601d1fd4ea2dffe183bce38f6f139.tar.gz
slixmpp-40196aefeb2601d1fd4ea2dffe183bce38f6f139.tar.bz2
slixmpp-40196aefeb2601d1fd4ea2dffe183bce38f6f139.tar.xz
slixmpp-40196aefeb2601d1fd4ea2dffe183bce38f6f139.zip
itests: add a command-line parameter to enable debug logs
Diffstat (limited to 'run_integration_tests.py')
-rwxr-xr-xrun_integration_tests.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/run_integration_tests.py b/run_integration_tests.py
index 9f670b5c..64e5b856 100755
--- a/run_integration_tests.py
+++ b/run_integration_tests.py
@@ -10,7 +10,7 @@ from importlib import import_module
from pathlib import Path
-def run_tests(filenames=None):
+def run_tests(filenames=None, debug=False):
"""
Find and run all tests in the tests/ directory.
@@ -33,9 +33,12 @@ def run_tests(filenames=None):
tests = unittest.TestSuite(suites)
runner = unittest.TextTestRunner(verbosity=2)
- # Disable logging output
- logging.basicConfig(level=100)
- logging.disable(100)
+ if debug:
+ logging.basicConfig(level='DEBUG')
+ else:
+ # Disable logging output
+ logging.basicConfig(level=100)
+ logging.disable(100)
result = runner.run(tests)
return result
@@ -60,9 +63,10 @@ class TestCommand(Command):
if __name__ == '__main__':
parser = ArgumentParser(description='Run unit tests.')
parser.add_argument('tests', metavar='TEST', nargs='*', help='list of tests to run, or nothing to run them all')
+ parser.add_argument('-d', '--debug', action='store_true', dest='debug', default=False, help='enable debug output')
args = parser.parse_args()
- result = run_tests(args.tests)
+ result = run_tests(args.tests, args.debug)
print("<tests %s ran='%s' errors='%s' fails='%s' success='%s'/>" % (
"xmlns='http//andyet.net/protocol/tests'",
result.testsRun, len(result.errors),