Commit 41998bb0 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Allow selecting test at command line

parent 1b632939
......@@ -72,7 +72,8 @@ def run_cli(debug, extras=None):
def run_test(debug, extras=None):
LOGGER.removeHandler(HANDLER)
from agkyra.scripts import test
test.main(debug)
selected_test = extras[0] if extras else None
test.main(debug, selected_test)
DISPATCH = {
......
......@@ -819,18 +819,25 @@ def set_debug(debug):
logger.setLevel(level)
def main(debug):
def main(debug, test=None):
if test is None:
test = "AgkyraTest"
set_debug(debug)
runner = unittest.TextTestRunner()
runner.run(unittest.makeSuite(AgkyraTest))
tl = unittest.TestLoader()
suite = tl.loadTestsFromName(__name__ + '.' + test)
runner.run(suite)
parser = argparse.ArgumentParser(description='Agkyra syncer launcher')
parser.add_argument('--debug', '-d', action='store_true',
help="set logging level to 'debug'")
parser.add_argument('test', nargs="?", default="AgkyraTest",
help="specify test to run")
if __name__ == '__main__':
args = parser.parse_args()
debug = args.debug
main(debug)
test = args.test
main(debug, test)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment