pytest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegenTestData = flag.Bool("regen", false, "Regenerate golden files from current testdata.")

Functions

func CompileSrc added in v0.1.0

func CompileSrc(t testing.TB, ctx py.Context, pySrc string, prog string) (*py.Module, *py.Code)

func RunBenchmarks added in v0.1.0

func RunBenchmarks(b *testing.B, testDir string)

RunBenchmarks runs the benchmarks in the directory passed in

func RunScript added in v0.2.0

func RunScript(t *testing.T, fname string)

RunScript runs the provided path to a script. RunScript captures the stdout and stderr while executing the script and compares it to a golden file, blocking until completion.

RunScript("./testdata/foo.py")

will compare the output with "./testdata/foo_golden.txt".

func RunTestTasks added in v0.2.0

func RunTestTasks(t *testing.T, tasks []*Task)

RunTestTasks runs each given task in a newly created py.Context concurrently. If a fatal error is encountered, the given testing.T is signaled.

func RunTests

func RunTests(t *testing.T, testDir string)

RunTests runs the tests in the directory passed in

Types

type Task added in v0.2.0

type Task struct {
	ID       string                     // unique key identifying this task.  If empty, autogenerated from the basename of PyFile
	PyFile   string                     // If set, this file pathname is executed in a newly created ctx
	PyTask   func(ctx py.Context) error // If set, a new created ctx is created and this blocks until completion
	GoldFile string                     // Filename containing the "gold standard" stdout+stderr.  If empty, autogenerated from PyFile or ID
	Err      error                      // Non-nil if a fatal error is encountered with this task
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy