diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e5781be5..d6f3369e 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## v4.0.0-alpha +## v4.0.0-beta (2022-04-24) - refactor: merge [hrp] into httprunner v4, which will include golang and python dual engine - refactor: redesign `IStep` to make step extensible to support implementing new protocols and test types @@ -165,6 +165,10 @@ - test: add CI test with [github actions][github-actions] - test: integrate [sentry sdk][sentry sdk] for event reporting and analysis +## 3.1.11 (2022-04-24) + +- fix #1273: ImportError by cannot import name '_unicodefun' from 'click' + ## 3.1.10 (2022-04-18) - fix #1249: catch exceptions when requesting with disabling allow_redirects diff --git a/examples/data/a_b_c/T1_test.py b/examples/data/a_b_c/T1_test.py index db722b78..d3273df7 100644 --- a/examples/data/a_b_c/T1_test.py +++ b/examples/data/a_b_c/T1_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: a-b.c/1.yml diff --git a/examples/data/a_b_c/T2_3_test.py b/examples/data/a_b_c/T2_3_test.py index eec4401b..a225b4cb 100644 --- a/examples/data/a_b_c/T2_3_test.py +++ b/examples/data/a_b_c/T2_3_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: a-b.c/2 3.yml diff --git a/examples/demo-with-go-plugin/plugin/debugtalk.go b/examples/demo-with-go-plugin/plugin/debugtalk.go index f99a1321..dbb37554 100644 --- a/examples/demo-with-go-plugin/plugin/debugtalk.go +++ b/examples/demo-with-go-plugin/plugin/debugtalk.go @@ -42,7 +42,7 @@ func TeardownHookExample(args string) string { } func GetVersion() string { - return "v4.0.0-alpha" + return "v4.0.0-beta" } func main() { diff --git a/examples/demo-with-py-plugin/debugtalk.py b/examples/demo-with-py-plugin/debugtalk.py index d30e6e63..180725e0 100644 --- a/examples/demo-with-py-plugin/debugtalk.py +++ b/examples/demo-with-py-plugin/debugtalk.py @@ -6,7 +6,7 @@ import funppy def get_httprunner_version(): - return "v4.0.0-alpha" + return "v4.0.0-beta" def sleep(n_secs): diff --git a/examples/httpbin/basic_test.py b/examples/httpbin/basic_test.py index eec02f1f..d13c87ac 100644 --- a/examples/httpbin/basic_test.py +++ b/examples/httpbin/basic_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: basic.yml diff --git a/examples/httpbin/hooks_test.py b/examples/httpbin/hooks_test.py index 0a696d8f..96302d35 100644 --- a/examples/httpbin/hooks_test.py +++ b/examples/httpbin/hooks_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: hooks.yml diff --git a/examples/httpbin/load_image_test.py b/examples/httpbin/load_image_test.py index d00e0e22..a43f5e75 100644 --- a/examples/httpbin/load_image_test.py +++ b/examples/httpbin/load_image_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: load_image.yml diff --git a/examples/httpbin/upload_test.py b/examples/httpbin/upload_test.py index f9ef8406..394ecbb6 100644 --- a/examples/httpbin/upload_test.py +++ b/examples/httpbin/upload_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: upload.yml diff --git a/examples/httpbin/validate_test.py b/examples/httpbin/validate_test.py index fe1c2b76..ae948113 100644 --- a/examples/httpbin/validate_test.py +++ b/examples/httpbin/validate_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: validate.yml diff --git a/examples/postman_echo/cookie_manipulation/hardcode_test.py b/examples/postman_echo/cookie_manipulation/hardcode_test.py index b69b0e40..f8d58a4d 100644 --- a/examples/postman_echo/cookie_manipulation/hardcode_test.py +++ b/examples/postman_echo/cookie_manipulation/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.7 +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: cookie_manipulation/hardcode.yml diff --git a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py index 77347c7a..371a5372 100644 --- a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py +++ b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v3.1.7 +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: cookie_manipulation/set_delete_cookies.yml diff --git a/examples/postman_echo/request_methods/demo_testsuite_yml/__init__.py b/examples/postman_echo/request_methods/demo_testsuite_yml/__init__.py deleted file mode 100644 index 70cfba53..00000000 --- a/examples/postman_echo/request_methods/demo_testsuite_yml/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# NOTICE: Generated By HttpRunner. DO NOT EDIT! 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 deleted file mode 100644 index 97593703..00000000 --- a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_functions_test.py +++ /dev/null @@ -1,86 +0,0 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha -# FROM: request_methods/request_with_functions.yml - - -from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase - - -class TestCaseRequestWithFunctions(HttpRunner): - - config = ( - Config("request with functions") - .variables( - **{ - "foo1": "testcase_ref_bar11", - "foo2": "testsuite_config_bar2", - "expect_foo1": "testcase_ref_bar11", - "expect_foo2": "testsuite_config_bar2", - } - ) - .base_url("https://postman-echo.com") - .verify(False) - .export(*["foo3"]) - ) - - teststeps = [ - Step( - RunRequest("get with params") - .with_variables( - **{"foo1": "bar11", "foo2": "bar21", "sum_v": "${sum_two(1, 2)}"} - ) - .get("/get") - .with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"}) - .with_headers(**{"User-Agent": "HttpRunner/${get_httprunner_version()}"}) - .extract() - .with_jmespath("body.args.foo2", "foo3") - .validate() - .assert_equal("status_code", 200) - .assert_equal("body.args.foo1", "bar11") - .assert_equal("body.args.sum_v", "3") - .assert_equal("body.args.foo2", "bar21") - ), - Step( - RunRequest("post raw text") - .with_variables(**{"foo1": "bar12", "foo3": "bar32"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "text/plain", - } - ) - .with_data( - "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." - ) - .validate() - .assert_equal("status_code", 200) - .assert_equal( - "body.data", - "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32.", - ) - .assert_type_match("body.json", "None") - .assert_type_match("body.json", "NoneType") - .assert_type_match("body.json", None) - ), - Step( - RunRequest("post form data") - .with_variables(**{"foo2": "bar23"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "application/x-www-form-urlencoded", - } - ) - .with_data("foo1=$foo1&foo2=$foo2&foo3=$foo3") - .validate() - .assert_equal("status_code", 200, "response status code should be 200") - .assert_equal("body.form.foo1", "$expect_foo1") - .assert_equal("body.form.foo2", "bar23") - .assert_equal("body.form.foo3", "bar21") - ), - ] - - -if __name__ == "__main__": - TestCaseRequestWithFunctions().test_start() 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 deleted file mode 100644 index 54d76e41..00000000 --- a/examples/postman_echo/request_methods/demo_testsuite_yml/request_with_testcase_reference_test.py +++ /dev/null @@ -1,65 +0,0 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha -# FROM: request_methods/request_with_testcase_reference.yml - - -import sys -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).parent.parent)) - - -from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase - -from request_methods.request_with_functions_test import ( - TestCaseRequestWithFunctions as RequestWithFunctions, -) - - -class TestCaseRequestWithTestcaseReference(HttpRunner): - - config = ( - Config("request with referenced testcase") - .variables( - **{ - "foo1": "testcase_ref_bar12", - "expect_foo1": "testcase_ref_bar12", - "expect_foo2": "testcase_ref_bar22", - "foo2": "testcase_ref_bar22", - } - ) - .base_url("https://postman-echo.com") - .verify(False) - ) - - teststeps = [ - Step( - RunTestCase("request with functions") - .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( - RunRequest("post form data") - .with_variables(**{"foo1": "bar1"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "application/x-www-form-urlencoded", - } - ) - .with_data("foo1=$foo1&foo2=$foo3") - .validate() - .assert_equal("status_code", 200) - .assert_equal("body.form.foo1", "bar1") - .assert_equal("body.form.foo2", "bar21") - ), - ] - - -if __name__ == "__main__": - TestCaseRequestWithTestcaseReference().test_start() diff --git a/examples/postman_echo/request_methods/hardcode_test.py b/examples/postman_echo/request_methods/hardcode_test.py index ba492426..a2b49836 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 v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/hardcode.yml diff --git a/examples/postman_echo/request_methods/request_with_functions_test.py b/examples/postman_echo/request_methods/request_with_functions_test.py index 90f14f36..8688765f 100644 --- a/examples/postman_echo/request_methods/request_with_functions_test.py +++ b/examples/postman_echo/request_methods/request_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/request_with_functions.yml diff --git a/examples/postman_echo/request_methods/request_with_parameters_test.py b/examples/postman_echo/request_methods/request_with_parameters_test.py index 5a538af5..5c6271a8 100644 --- a/examples/postman_echo/request_methods/request_with_parameters_test.py +++ b/examples/postman_echo/request_methods/request_with_parameters_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/request_with_parameters.yml diff --git a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py index 71305153..6a55b63a 100644 --- a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py +++ b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/request_with_testcase_reference.yml 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 61d9382b..0c7c0f77 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 v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/request_with_variables.yml 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 d2f58894..2ad1b58f 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 v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/validate_with_functions.yml 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 eaa20726..26fa76bc 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 v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: request_methods/validate_with_variables.yml diff --git a/hrp/internal/scaffold/templates/plugin/debugtalk.go b/hrp/internal/scaffold/templates/plugin/debugtalk.go index f99a1321..dbb37554 100644 --- a/hrp/internal/scaffold/templates/plugin/debugtalk.go +++ b/hrp/internal/scaffold/templates/plugin/debugtalk.go @@ -42,7 +42,7 @@ func TeardownHookExample(args string) string { } func GetVersion() string { - return "v4.0.0-alpha" + return "v4.0.0-beta" } func main() { diff --git a/hrp/internal/scaffold/templates/plugin/debugtalk.py b/hrp/internal/scaffold/templates/plugin/debugtalk.py index d30e6e63..180725e0 100644 --- a/hrp/internal/scaffold/templates/plugin/debugtalk.py +++ b/hrp/internal/scaffold/templates/plugin/debugtalk.py @@ -6,7 +6,7 @@ import funppy def get_httprunner_version(): - return "v4.0.0-alpha" + return "v4.0.0-beta" def sleep(n_secs): diff --git a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py index e8707a57..deae0a81 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py +++ b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: testcases/demo_ref_testcase.yml diff --git a/hrp/internal/scaffold/templates/testcases/demo_requests_test.py b/hrp/internal/scaffold/templates/testcases/demo_requests_test.py index 526961e3..5ce8a6d8 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_requests_test.py +++ b/hrp/internal/scaffold/templates/testcases/demo_requests_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-alpha +# NOTE: Generated By HttpRunner v4.0.0-beta # FROM: testcases/demo_requests.yml diff --git a/hrp/internal/version/init.go b/hrp/internal/version/init.go index 720fe5c6..ca433250 100644 --- a/hrp/internal/version/init.go +++ b/hrp/internal/version/init.go @@ -1,3 +1,3 @@ package version -const VERSION = "v4.0.0-alpha" +const VERSION = "v4.0.0-beta" diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 5c6dcfe5..1329604f 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.0.0-alpha" +__version__ = "4.0.0-beta" __description__ = "One-stop solution for HTTP(S) testing." from httprunner.config import Config diff --git a/pyproject.toml b/pyproject.toml index b1a5bf99..9c098cf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "4.0.0-alpha" +version = "4.0.0-beta" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md" diff --git a/scripts/install.sh b/scripts/install.sh index d26b93b6..dfc11491 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # install hrp with one shell command # bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)" -LATEST_VERSION="v4.0.0-alpha" +LATEST_VERSION="v4.0.0-beta" set -e