mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 06:19:34 +08:00
feat: check if specified python3 venv is invalid
This commit is contained in:
@@ -9,6 +9,10 @@
|
|||||||
- refactor: build plugin mechanism
|
- refactor: build plugin mechanism
|
||||||
- fix: pip upgrade httprunner when installing hrp
|
- fix: pip upgrade httprunner when installing hrp
|
||||||
|
|
||||||
|
**python version**
|
||||||
|
|
||||||
|
fix: unexpected changes in step variables
|
||||||
|
|
||||||
## v4.1.2 (2022-06-09)
|
## v4.1.2 (2022-06-09)
|
||||||
|
|
||||||
- feat: add Dockerfile
|
- feat: add Dockerfile
|
||||||
|
|||||||
@@ -92,13 +92,14 @@ func FormatResponse(raw interface{}) interface{} {
|
|||||||
var Python3Executable string = "python3" // system default python3
|
var Python3Executable string = "python3" // system default python3
|
||||||
|
|
||||||
func PrepareVenv(venv string) error {
|
func PrepareVenv(venv string) error {
|
||||||
defer func() {
|
|
||||||
log.Info().Str("Python3Executable", Python3Executable).Msg("set python3 executable path")
|
|
||||||
}()
|
|
||||||
|
|
||||||
// specify python3 venv
|
// specify python3 venv
|
||||||
if venv != "" {
|
if venv != "" {
|
||||||
Python3Executable = getPython3Executable(venv)
|
python3 := getPython3Executable(venv)
|
||||||
|
if !IsFilePathExists(python3) {
|
||||||
|
return errors.New("specified python3 venv is invalid")
|
||||||
|
}
|
||||||
|
Python3Executable = python3
|
||||||
|
log.Info().Str("Python3Executable", Python3Executable).Msg("set python3 executable path")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ func PrepareVenv(venv string) error {
|
|||||||
return errors.Wrap(err, "create default python3 venv failed")
|
return errors.Wrap(err, "create default python3 venv failed")
|
||||||
}
|
}
|
||||||
Python3Executable = python3
|
Python3Executable = python3
|
||||||
|
log.Info().Str("Python3Executable", Python3Executable).Msg("set python3 executable path")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user