mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 22:39:42 +08:00
refactor: use HttpRunner as testcase base class
This commit is contained in:
@@ -10,10 +10,10 @@ from httprunner.exceptions import TestCaseFormatError
|
||||
from httprunner.loader import load_testcase_file, load_folder_files
|
||||
|
||||
__TMPL__ = """# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||
from httprunner import HttpRunner, TConfig, TStep, TestCase
|
||||
from httprunner import HttpRunner, TConfig, TStep
|
||||
|
||||
|
||||
class {{ class_name }}(TestCase):
|
||||
class {{ class_name }}(HttpRunner):
|
||||
config = TConfig(**{{ config }})
|
||||
|
||||
teststeps = [
|
||||
@@ -22,8 +22,8 @@ class {{ class_name }}(TestCase):
|
||||
{% endfor %}
|
||||
]
|
||||
|
||||
def test_start(self):
|
||||
HttpRunner(self.config, self.teststeps).run()
|
||||
if __name__ == "__main__":
|
||||
{{ class_name }}().test_start()
|
||||
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user