From 2681d4c8157536d8ffdb3ec9719a351b6957c35d Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 22 Apr 2022 11:56:31 +0800 Subject: [PATCH] change: remove hrun command --- hrp/cmd/scaffold.go | 2 +- hrp/runner.go | 1 + httprunner/cli.py | 20 -------------------- pyproject.toml | 1 - 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/hrp/cmd/scaffold.go b/hrp/cmd/scaffold.go index 0d065839..a9e7aac9 100644 --- a/hrp/cmd/scaffold.go +++ b/hrp/cmd/scaffold.go @@ -19,7 +19,7 @@ var scaffoldCmd = &cobra.Command{ }, RunE: func(cmd *cobra.Command, args []string) error { if !ignorePlugin && !genPythonPlugin && !genGoPlugin { - return errors.New("please select function plugin type") + return errors.New("please specify function plugin type") } var pluginType scaffold.PluginType diff --git a/hrp/runner.go b/hrp/runner.go index e73ae616..057bdabd 100644 --- a/hrp/runner.go +++ b/hrp/runner.go @@ -153,6 +153,7 @@ func (r *HRPRunner) Run(testcases ...ITestCase) error { // load all testcases testCases, err := loadTestCases(testcases...) if err != nil { + log.Error().Err(err).Msg("failed to load testcases") return err } diff --git a/httprunner/cli.py b/httprunner/cli.py index 1aa29eac..2257ba97 100644 --- a/httprunner/cli.py +++ b/httprunner/cli.py @@ -108,26 +108,6 @@ def main(): main_make(args.testcase_path) -def main_hrun_alias(): - """ command alias - hrun = httprunner run - """ - if len(sys.argv) == 2: - if sys.argv[1] in ["-V", "--version"]: - # hrun -V - sys.argv = ["httprunner", "-V"] - elif sys.argv[1] in ["-h", "--help"]: - pytest.main(["-h"]) - sys.exit(0) - else: - # hrun /path/to/testcase - sys.argv.insert(1, "run") - else: - sys.argv.insert(1, "run") - - main() - - def main_make_alias(): """ command alias hmake = httprunner make diff --git a/pyproject.toml b/pyproject.toml index 0f7c8e75..bdd45f2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,6 @@ coverage = "^4.5.4" [tool.poetry.scripts] httprunner = "httprunner.cli:main" -hrun = "httprunner.cli:main_hrun_alias" hmake = "httprunner.cli:main_make_alias" [build-system]