mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 00:09:37 +08:00
feat #1342: support specify custom python3 venv
This commit is contained in:
@@ -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...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user