feat: get raw testcase model from pytest file

This commit is contained in:
debugtalk
2020-06-03 21:36:05 +08:00
parent e017b9b3fd
commit 82b8975691
2 changed files with 8 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ make_files_cache_set: Set = set()
pytest_files_set: Set = set()
__TEMPLATE__ = jinja2.Template(
"""# NOTICE: Generated By HttpRunner. DO NOT EDIT!
"""# NOTICE: Generated By HttpRunner.
# FROM: {{ testcase_path }}
{% if imports_list %}
import os

View File

@@ -58,6 +58,13 @@ class HttpRunner(object):
for step in self.teststeps:
self.__teststeps.append(step.perform())
@property
def raw_testcase(self) -> TestCase:
if not hasattr(self, "__config"):
self.__init_tests__()
return TestCase(config=self.__config, teststeps=self.__teststeps)
def with_project_meta(self, project_meta: ProjectMeta) -> "HttpRunner":
self.__project_meta = project_meta
return self