mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 08:19:45 +08:00
feat #1342: support specify custom python3 venv
This commit is contained in:
@@ -58,6 +58,7 @@ type HRPRunner struct {
|
||||
httpStatOn bool
|
||||
requestsLogOn bool
|
||||
pluginLogOn bool
|
||||
venv string
|
||||
saveTests bool
|
||||
genHTMLReport bool
|
||||
httpClient *http.Client
|
||||
@@ -116,6 +117,13 @@ func (r *HRPRunner) SetPluginLogOn() *HRPRunner {
|
||||
return r
|
||||
}
|
||||
|
||||
// SetPython3Venv specifies python3 venv.
|
||||
func (r *HRPRunner) SetPython3Venv(venv string) *HRPRunner {
|
||||
log.Info().Str("venv", venv).Msg("[init] SetPython3Venv")
|
||||
r.venv = venv
|
||||
return r
|
||||
}
|
||||
|
||||
// SetProxyUrl configures the proxy URL, which is usually used to capture HTTP packets for debugging.
|
||||
func (r *HRPRunner) SetProxyUrl(proxyUrl string) *HRPRunner {
|
||||
log.Info().Str("proxyUrl", proxyUrl).Msg("[init] SetProxyUrl")
|
||||
@@ -235,7 +243,7 @@ func (r *HRPRunner) newCaseRunner(testcase *TestCase) (*testCaseRunner, error) {
|
||||
}
|
||||
|
||||
// init parser plugin
|
||||
plugin, err := initPlugin(testcase.Config.Path, r.pluginLogOn)
|
||||
plugin, err := initPlugin(testcase.Config.Path, r.venv, r.pluginLogOn)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "init plugin failed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user