mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 16:29:37 +08:00
change: rename TestCaseInOut field
This commit is contained in:
@@ -104,7 +104,7 @@ class HttpRunner(object):
|
|||||||
result = self.unittest_runner.run(testcase)
|
result = self.unittest_runner.run(testcase)
|
||||||
testcase_summary = report.get_summary(result)
|
testcase_summary = report.get_summary(result)
|
||||||
testcase_summary.in_out.vars = testcase.config.variables
|
testcase_summary.in_out.vars = testcase.config.variables
|
||||||
testcase_summary.in_out.out = testcase.config.export
|
testcase_summary.in_out.export = testcase.config.export
|
||||||
|
|
||||||
if self.save_tests and log_handler:
|
if self.save_tests and log_handler:
|
||||||
logger.remove(log_handler)
|
logger.remove(log_handler)
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class HttpRunner(object):
|
|||||||
self.duration = time.time() - self.start_at
|
self.duration = time.time() - self.start_at
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def get_export_variables(self):
|
def get_export_variables(self) -> Dict:
|
||||||
export_vars_mapping = {}
|
export_vars_mapping = {}
|
||||||
for var_name in self.config.export:
|
for var_name in self.config.export:
|
||||||
if var_name not in self.session_variables:
|
if var_name not in self.session_variables:
|
||||||
@@ -196,15 +196,17 @@ class HttpRunner(object):
|
|||||||
start_at_timestamp = self.start_at
|
start_at_timestamp = self.start_at
|
||||||
start_at_iso_format = datetime.utcfromtimestamp(start_at_timestamp).isoformat()
|
start_at_iso_format = datetime.utcfromtimestamp(start_at_timestamp).isoformat()
|
||||||
return TestCaseSummary(
|
return TestCaseSummary(
|
||||||
|
name=self.config.name,
|
||||||
success=self.success,
|
success=self.success,
|
||||||
time=TestCaseTime(
|
time=TestCaseTime(
|
||||||
start_at=self.start_at,
|
start_at=self.start_at,
|
||||||
start_at_iso_format=start_at_iso_format,
|
start_at_iso_format=start_at_iso_format,
|
||||||
duration=self.duration,
|
duration=self.duration,
|
||||||
),
|
),
|
||||||
name=self.config.name,
|
|
||||||
# status=result.status,
|
# status=result.status,
|
||||||
# attachment=result.attachment,
|
# attachment=result.attachment,
|
||||||
in_out=TestCaseInOut(vars=self.config.variables, out=self.config.export),
|
in_out=TestCaseInOut(
|
||||||
|
vars=self.config.variables, export=self.get_export_variables()
|
||||||
|
),
|
||||||
step_datas=self.step_datas,
|
step_datas=self.step_datas,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class TestCaseTime(BaseModel):
|
|||||||
|
|
||||||
class TestCaseInOut(BaseModel):
|
class TestCaseInOut(BaseModel):
|
||||||
vars: VariablesMapping = {}
|
vars: VariablesMapping = {}
|
||||||
out: Export = []
|
export: Dict = {}
|
||||||
|
|
||||||
|
|
||||||
class RequestStat(BaseModel):
|
class RequestStat(BaseModel):
|
||||||
|
|||||||
Reference in New Issue
Block a user