MCPcopy Create free account
hub / github.com/apache/impala / TestExecutor

Class TestExecutor

tests/run-tests.py:107–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105
106
107class TestExecutor(object):
108 def __init__(self, exit_on_error=True):
109 self._exit_on_error = exit_on_error
110 self.tests_failed = False
111 self.total_executed = 0
112
113 def run_tests(self, args):
114 testcounterplugin = TestCounterPlugin()
115
116 try:
117 string_args = [str(a) for a in args]
118 pytest_exit_code = pytest.main(string_args, plugins=[testcounterplugin])
119 except Exception:
120 sys.stderr.write("Unexpected exception with pytest {0}".format(args))
121 raise
122
123 if '--collect-only' in args:
124 for test in testcounterplugin.tests_collected:
125 print(test)
126
127 self.total_executed += len(testcounterplugin.tests_executed)
128
129 if 0 < pytest_exit_code < ExitCode.NO_TESTS_COLLECTED and self._exit_on_error:
130 sys.exit(pytest_exit_code)
131 self.tests_failed = (0 < pytest_exit_code < ExitCode.NO_TESTS_COLLECTED
132 or self.tests_failed)
133
134
135def get_explicit_tests(args):

Callers 1

run-tests.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected