mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-11 18:59:39 +08:00
feat: get raw testcase model from pytest file
This commit is contained in:
@@ -24,7 +24,7 @@ make_files_cache_set: Set = set()
|
|||||||
pytest_files_set: Set = set()
|
pytest_files_set: Set = set()
|
||||||
|
|
||||||
__TEMPLATE__ = jinja2.Template(
|
__TEMPLATE__ = jinja2.Template(
|
||||||
"""# NOTICE: Generated By HttpRunner. DO NOT EDIT!
|
"""# NOTICE: Generated By HttpRunner.
|
||||||
# FROM: {{ testcase_path }}
|
# FROM: {{ testcase_path }}
|
||||||
{% if imports_list %}
|
{% if imports_list %}
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ class HttpRunner(object):
|
|||||||
for step in self.teststeps:
|
for step in self.teststeps:
|
||||||
self.__teststeps.append(step.perform())
|
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":
|
def with_project_meta(self, project_meta: ProjectMeta) -> "HttpRunner":
|
||||||
self.__project_meta = project_meta
|
self.__project_meta = project_meta
|
||||||
return self
|
return self
|
||||||
|
|||||||
Reference in New Issue
Block a user