pytest

package
v0.0.0-...-e3d350f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert[T any](t T, e error) T

panics if there is an error

Types

type Test

type Test string

type TestCase

type TestCase struct {
	XMLName   xml.Name      `xml:"testcase"`
	ClassName string        `xml:"classname,attr"`
	Name      string        `xml:"name,attr"`
	Time      float64       `xml:"time,attr"`
	Failures  []TestFailure `xml:"failure"`
	Errors    []TestError   `xml:"error"`
}

func CalculateTestCasesFromPath

func CalculateTestCasesFromPath(ctx context.Context, g git.Git, c cache.Cacher, path string) []TestCase

func (*TestCase) Path

func (t *TestCase) Path(root string) string

type TestError

type TestError struct {
	XMLName xml.Name `xml:"error"`
	Message string   `xml:"message,attr"`
}

type TestFailure

type TestFailure struct {
	XMLName   xml.Name `xml:"failure"`
	Message   string   `xml:"message,attr"`
	SystemOut string   `xml:"system-out,attr"`
	SystemErr string   `xml:"system-err,attr"`
}

type TestResult

type TestResult struct {
	XMLName    xml.Name    `xml:"testsuites"`
	TestSuites []TestSuite `xml:"testsuite"`
}

type TestSuite

type TestSuite struct {
	XMLName   xml.Name   `xml:"testsuite"`
	Name      string     `xml:"name,attr"`
	Errors    int        `xml:"errors,attr"`
	Failures  int        `xml:"failures,attr"`
	Skipped   int        `xml:"skipped,attr"`
	Tests     int        `xml:"tests,attr"`
	TestCases []TestCase `xml:"testcase"`
	Paths     file.Paths
	// contains filtered or unexported fields
}

func RunPaths

func RunPaths(ctx context.Context, g git.Git, c cache.Cacher, switches []string, paths []string, v cache.Version) (TestSuite, error)

func RunTests

func RunTests(ctx context.Context, g git.Git, c cache.Cacher, switches []string, tests []TestCase, v cache.Version) (TestSuite, error)

func (*TestSuite) GetFailures

func (t *TestSuite) GetFailures() []TestCase

type Tests

type Tests []Test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL