MCPcopy Index your code
hub / github.com/httprunner/httprunner / test_start

Method test_start

httprunner/runner.py:211–243  ·  view source on GitHub ↗

main entrance, discovered by pytest

(self, param: Dict = None)

Source from the content-addressed store, hash-verified

209 logger.info(f"run step end: {step.name()} <<<<<<\n")
210
211 def test_start(self, param: Dict = None) -> "SessionRunner":
212 """main entrance, discovered by pytest"""
213 ga4_client.send_event("test_start")
214 print("\n")
215 self.__init()
216 self.__parse_config(param)
217
218 if ALLURE is not None and not self.__is_referenced:
219 # update allure report meta
220 ALLURE.dynamic.title(self.__config.name)
221 ALLURE.dynamic.description(f"TestCase ID: {self.case_id}")
222
223 logger.info(
224 f"Start to run testcase: {self.__config.name}, TestCase ID: {self.case_id}"
225 )
226
227 logger.add(self.__log_path, format=LOGGER_FORMAT, level="DEBUG")
228 self.__start_at = time.time()
229 try:
230 # run step in sequential order
231 for step in self.teststeps:
232 self.__run_step(step)
233 finally:
234 logger.info(f"generate testcase log: {self.__log_path}")
235 if ALLURE is not None:
236 ALLURE.attach.file(
237 self.__log_path,
238 name="all log",
239 attachment_type=ALLURE.attachment_type.TEXT,
240 )
241
242 self.__duration = time.time() - self.__start_at
243 return self
244
245
246class HttpRunner(SessionRunner):

Callers 5

setUpMethod · 0.45
test_run_requestMethod · 0.45
run_step_testcaseFunction · 0.45

Calls 4

__initMethod · 0.95
__parse_configMethod · 0.95
__run_stepMethod · 0.95
send_eventMethod · 0.80

Tested by

no test coverage detected