diff --git a/examples/httpbin/basic_test.py b/examples/httpbin/basic_test.py index 3f912332..f541798f 100644 --- a/examples/httpbin/basic_test.py +++ b/examples/httpbin/basic_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: basic.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/httpbin/hooks_test.py b/examples/httpbin/hooks_test.py index b9d12e1a..36d134e0 100644 --- a/examples/httpbin/hooks_test.py +++ b/examples/httpbin/hooks_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: hooks.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/httpbin/load_image_test.py b/examples/httpbin/load_image_test.py index ecbd0aa5..47b05af1 100644 --- a/examples/httpbin/load_image_test.py +++ b/examples/httpbin/load_image_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: load_image.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/httpbin/upload_test.py b/examples/httpbin/upload_test.py index 826aae8f..cdec89fd 100644 --- a/examples/httpbin/upload_test.py +++ b/examples/httpbin/upload_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: upload.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/httpbin/validate_test.py b/examples/httpbin/validate_test.py index bbbc58e8..ed15c14d 100644 --- a/examples/httpbin/validate_test.py +++ b/examples/httpbin/validate_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: validate.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py b/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py index 7030055a..50eb0cc8 100644 --- a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py +++ b/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py @@ -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 diff --git a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py b/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py index 63a5b73e..2d131814 100644 --- a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py +++ b/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py @@ -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 @@ -35,7 +35,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( diff --git a/examples/postman_echo/request_methods/hardcode_test.py b/examples/postman_echo/request_methods/hardcode_test.py index 95e1e421..70e5e3c9 100644 --- a/examples/postman_echo/request_methods/hardcode_test.py +++ b/examples/postman_echo/request_methods/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: request_methods/hardcode.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/postman_echo/request_methods/request_with_variables_test.py b/examples/postman_echo/request_methods/request_with_variables_test.py index 74f38b37..cacc4621 100644 --- a/examples/postman_echo/request_methods/request_with_variables_test.py +++ b/examples/postman_echo/request_methods/request_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: request_methods/request_with_variables.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/postman_echo/request_methods/validate_with_functions_test.py b/examples/postman_echo/request_methods/validate_with_functions_test.py index 68179d7b..4b67bba5 100644 --- a/examples/postman_echo/request_methods/validate_with_functions_test.py +++ b/examples/postman_echo/request_methods/validate_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: request_methods/validate_with_functions.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/examples/postman_echo/request_methods/validate_with_variables_test.py b/examples/postman_echo/request_methods/validate_with_variables_test.py index 83225fa5..07f6d5b3 100644 --- a/examples/postman_echo/request_methods/validate_with_variables_test.py +++ b/examples/postman_echo/request_methods/validate_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.0 +# NOTE: Generated By HttpRunner v3.1.2 # FROM: request_methods/validate_with_variables.yml from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase diff --git a/httprunner/loader.py b/httprunner/loader.py index 8a28f0ed..afaae632 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -137,7 +137,9 @@ def load_dot_env_file(dot_env_path: Text) -> Dict: else: raise exceptions.FileFormatError(".env format error") - env_variables_mapping[variable.strip().decode("utf-8")] = value.strip().decode("utf-8") + env_variables_mapping[ + variable.strip().decode("utf-8") + ] = value.strip().decode("utf-8") utils.set_os_environ(env_variables_mapping) return env_variables_mapping