pytest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(
	ctx context.Context, args []string, deadline time.Duration, env []string,
) (*xpytest_proto.TestResult, error)

Execute executes a command.

Types

type Pytest

type Pytest struct {
	PythonCmd        string
	MarkerExpression string
	Xdist            int
	Files            []string
	Executor         func(
		context.Context, []string, time.Duration, []string,
	) (*xpytest_proto.TestResult, error)
	Retry    int
	Env      []string
	Deadline time.Duration
}

Pytest represents one pytest execution.

func NewPytest

func NewPytest(pythonCmd string) *Pytest

NewPytest creates a new Pytest object.

func (*Pytest) Execute

func (p *Pytest) Execute(
	ctx context.Context,
) (*Result, error)

Execute builds pytest parameters and runs pytest.

type Result

type Result struct {
	Status xpytest_proto.TestResult_Status
	Name   string
	// contains filtered or unexported fields
}

Result represents a pytest execution result.

func (*Result) Output

func (r *Result) Output() string

Output returns the test result. This returns outputs from STDOUT/STDERR in addition to a one-line summary returned by Summary.

func (*Result) Summary

func (r *Result) Summary() string

Summary returns a one-line summary of the test result (e.g., "[SUCCESS] test_foo.py (123 passed in 4.56 seconds)").

Jump to

Keyboard shortcuts

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