MCPcopy Create free account
hub / github.com/cztomczak/cefpython / main

Function main

unittests/_test_runner.py:38–65  ·  view source on GitHub ↗

Main entry point.

(file_arg="")

Source from the content-addressed store, hash-verified

36
37
38def main(file_arg=""):
39 # type: (str) -> None
40 """Main entry point."""
41
42 # Set working dir to script's current
43 os.chdir(dirname(realpath(__file__)))
44
45 # Script arguments
46 testcase_arg = ""
47 if len(sys.argv) > 1 and sys.argv[1].startswith("--"):
48 # Will allow to pass custom args like --debug to isolated tests
49 # (main_test.py for example).
50 global CUSTOM_CMDLINE_ARG
51 CUSTOM_CMDLINE_ARG = sys.argv[1]
52 elif len(sys.argv) > 1:
53 if ".py" in sys.argv[1]:
54 file_arg = sys.argv[1]
55 else:
56 testcase_arg = sys.argv[1]
57
58 # Run tests
59 runner = TestRunner()
60 if testcase_arg:
61 runner.run_testcase(testcase_arg)
62 elif file_arg:
63 runner.run_file(file_arg)
64 else:
65 runner.run_all()
66
67
68class TestRunner(object):

Callers 1

_test_runner.pyFile · 0.70

Calls 4

run_testcaseMethod · 0.95
run_fileMethod · 0.95
run_allMethod · 0.95
TestRunnerClass · 0.85

Tested by

no test coverage detected