fix: missing setup/teardown hooks for referenced testcase

This commit is contained in:
debugtalk
2020-06-23 16:27:08 +08:00
parent 35db0a67f3
commit 2c638ed52c
8 changed files with 46 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v3.1.0
# NOTE: Generated By HttpRunner v3.1.2
# FROM: request_methods/request_with_functions.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -13,7 +13,11 @@ teststeps:
variables:
foo1: testcase_ref_bar1
expect_foo1: testcase_ref_bar1
setup_hooks:
- ${sleep(0.1)}
testcase: request_methods/request_with_functions.yml
teardown_hooks:
- ${sleep(0.2)}
export:
- foo3
-

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v3.1.0
# NOTE: Generated By HttpRunner v3.1.2
# FROM: request_methods/request_with_testcase_reference.yml
import sys
@@ -33,7 +33,9 @@ class TestCaseRequestWithTestcaseReference(HttpRunner):
.with_variables(
**{"foo1": "testcase_ref_bar1", "expect_foo1": "testcase_ref_bar1"}
)
.setup_hook("${sleep(0.1)}")
.call(RequestWithFunctions)
.teardown_hook("${sleep(0.2)}")
.export(*["foo3"])
),
Step(