mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-08 15:13:38 +08:00
feat #1342: support specify custom python3 venv
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/pytest"
|
||||
)
|
||||
|
||||
@@ -15,6 +17,11 @@ var pytestCmd = &cobra.Command{
|
||||
},
|
||||
DisableFlagParsing: true, // allow to pass any args to pytest
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
err := builtin.PrepareVenv(venv)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("prepare python3 venv failed")
|
||||
return err
|
||||
}
|
||||
return pytest.RunPytest(args)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user