mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
feat: print output with colors
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
package pytest
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/httprunner/hrp/internal/builtin"
|
||||
)
|
||||
@@ -17,15 +13,5 @@ func RunPytest(args []string) error {
|
||||
}
|
||||
|
||||
args = append([]string{"-m", "httprunner", "run"}, args...)
|
||||
cmd := exec.Command(python3, args...)
|
||||
log.Info().Str("cmd", cmd.String()).Msg("run pytest")
|
||||
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "pytest running failed")
|
||||
}
|
||||
out := strings.TrimSpace(string(output))
|
||||
println(out)
|
||||
|
||||
return nil
|
||||
return builtin.ExecCommand(python3, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user