feat #1342: support specify custom python3 venv

This commit is contained in:
debugtalk
2022-06-13 14:02:36 +08:00
parent f24c453890
commit 182d2fd5d8
35 changed files with 381 additions and 123 deletions

View File

@@ -1,11 +1,8 @@
package pytest
import (
"fmt"
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
"github.com/httprunner/httprunner/v4/hrp/internal/sdk"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
)
func RunPytest(args []string) error {
@@ -14,12 +11,6 @@ func RunPytest(args []string) error {
Action: "hrp pytest",
})
httprunner := fmt.Sprintf("httprunner>=%s", version.HttpRunnerMinVersion)
python3, err := builtin.EnsurePython3Venv(httprunner)
if err != nil {
return err
}
args = append([]string{"-m", "httprunner", "run"}, args...)
return builtin.ExecCommand(python3, args...)
args = append([]string{"run"}, args...)
return builtin.ExecPython3Command("httprunner", args...)
}