webdriver_test_tools.project.test_module module

Functions for test project __main__ modules

webdriver_test_tools.project.test_module.main(tests_module, config_module=None, package_name=None)[source]

Function to call in test modules if __name__ == '__main__' at run time

Commands will return an exit code, which is passed to sys.exit(). If an exception is caught during execution, the exit code is set to 1 and the error message is printed out.

If the command is not recognized, but somehow execution continues after parser.parse_args() is called, a help message will be printed and the exit code will be set to 1.

Parameters
  • tests_module – The module object for <test_project>.tests

  • config_module – (Optional) The module object for <test_project>.config. Will use webdriver_test_tools.config if not specified

  • package_name – (Optional) The name of the package (i.e. __package__)

webdriver_test_tools.project.test_module.get_parser(config_module=None, package_name=None)[source]

Returns the ArgumentParser object for use with main()

Parameters
  • config_module – (Optional) The module object for <test_project>.config. Will use webdriver_test_tools.config if not specified if unspecified

  • package_name – (Optional) The name of the package (i.e. __package__)

Returns

ArgumentParser for the test package