def main() -> None: """Main function. Parse arguments and pass them to module. """ parser = argparse.ArgumentParser(description='Pipenv simple skeleton.') parser.add_argument('foo', help='foo bar') args = parser.parse_args() Module.main(args.foo)
#__author:jack #date 2019-12-26 12:55 import sys, os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) from module import main from logs import log main.main() log.info("logging info")
def test_main(): assert 0 == main.main()
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from module.main import main args = sys.argv[1] main(args)