Files
httprunner/hrp/cmd/pytest.go
2022-05-09 19:53:16 +08:00

25 lines
521 B
Go

package cmd
import (
"github.com/spf13/cobra"
"github.com/httprunner/httprunner/v4/hrp/internal/pytest"
)
var pytestCmd = &cobra.Command{
Use: "pytest $path ...",
Short: "run API test with pytest",
Args: cobra.MinimumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
setLogLevel(logLevel)
},
DisableFlagParsing: true, // allow to pass any args to pytest
RunE: func(cmd *cobra.Command, args []string) error {
return pytest.RunPytest(args)
},
}
func init() {
rootCmd.AddCommand(pytestCmd)
}