mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +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()
|
||||
|
||||
__TEMPLATE__ = jinja2.Template(
|
||||
"""# NOTICE: Generated By HttpRunner. DO NOT EDIT!
|
||||
"""# NOTICE: Generated By HttpRunner.
|
||||
# FROM: {{ testcase_path }}
|
||||
{% if imports_list %}
|
||||
import os
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user