(self, args)
| 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 | |
| 135 | def get_explicit_tests(args): |
no test coverage detected