{"modulePath":"github.com/go-python/gpython","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pytest\n\n## Variables\n\n```go\nvar RegenTestData = flag.Bool(\"regen\", false, \"Regenerate golden files from current testdata.\")\n```\n\n## Functions\n\n```go\nfunc CompileSrc(t testing.TB, ctx py.Context, pySrc string, prog string) (*py.Module, *py.Code)\n```\n\n```go\nfunc RunBenchmarks(b *testing.B, testDir string)\n```\nRunBenchmarks runs the benchmarks in the directory passed in\n\n```go\nfunc RunScript(t *testing.T, fname string)\n```\nRunScript 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.\n\n\tRunScript(\"./testdata/foo.py\")\n\nwill compare the output with \"./testdata/foo\\_golden.txt\".\n\n```go\nfunc RunTestTasks(t *testing.T, tasks []*Task)\n```\nRunTestTasks runs each given task in a newly created py.Context concurrently. If a fatal error is encountered, the given testing.T is signaled.\n\n```go\nfunc RunTests(t *testing.T, testDir string)\n```\nRunTests runs the tests in the directory passed in\n\n## Types\n\n```go\ntype Task struct {\n\tID       string                     // unique key identifying this task.  If empty, autogenerated from the basename of PyFile\n\tPyFile   string                     // If set, this file pathname is executed in a newly created ctx\n\tPyTask   func(ctx py.Context) error // If set, a new created ctx is created and this blocks until completion\n\tGoldFile string                     // Filename containing the \"gold standard\" stdout+stderr.  If empty, autogenerated from PyFile or ID\n\tErr      error                      // Non-nil if a fatal error is encountered with this task\n\t// contains filtered or unexported fields\n}\n```\n\n","path":"github.com/go-python/gpython/pytest","name":"pytest","synopsis":"","isRedistributable":true}
