mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
25 lines
521 B
Go
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)
|
|
}
|