feat: make referenced testcase as pytest class

This commit is contained in:
debugtalk
2020-05-25 17:53:22 +08:00
parent 0fecee38e4
commit c02ab453dc
8 changed files with 131 additions and 22 deletions

View File

@@ -2,6 +2,10 @@
# FROM: examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference.yml
from httprunner import HttpRunner, TConfig, TStep
from examples.postman_echo.request_methods.request_with_functions_test import (
TestCaseRequestWithFunctions,
)
class TestCaseRequestWithTestcaseReference(HttpRunner):
config = TConfig(
@@ -19,7 +23,7 @@ class TestCaseRequestWithTestcaseReference(HttpRunner):
**{
"name": "request with functions",
"variables": {"foo1": "override_bar1"},
"testcase": "request_methods/request_with_functions.yml",
"testcase": TestCaseRequestWithFunctions,
}
),
]

View File

@@ -2,6 +2,10 @@
# FROM: examples/postman_echo/request_methods/request_with_testcase_reference.yml
from httprunner import HttpRunner, TConfig, TStep
from examples.postman_echo.request_methods.request_with_functions_test import (
TestCaseRequestWithFunctions,
)
class TestCaseRequestWithTestcaseReference(HttpRunner):
config = TConfig(
@@ -19,7 +23,7 @@ class TestCaseRequestWithTestcaseReference(HttpRunner):
**{
"name": "request with functions",
"variables": {"foo1": "override_bar1"},
"testcase": "request_methods/request_with_functions.yml",
"testcase": TestCaseRequestWithFunctions,
}
),
]