testenv
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package testenv provides utility functions for tests. It does not depend onthe `testing` package to allow usage in non-test code.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcAssertInTest¶added inv1.84.0
func AssertInTest()
AssertInTest panics if called outside of a test binary.
funcInParallelTest¶added inv1.84.0
InParallelTest reports whether t is running as a parallel test.
Use of this function taints t such that its Parallel method (assuming t is anactual *testing.T) will panic if called after this function.
Types¶
typeTB¶added inv1.84.0
type TB interface {Cleanup(func())Error(args ...any)Errorf(formatstring, args ...any)Fail()FailNow()Failed()boolFatal(args ...any)Fatalf(formatstring, args ...any)Helper()Log(args ...any)Logf(formatstring, args ...any)Name()stringSetenv(key, valuestring)Chdir(dirstring)Skip(args ...any)SkipNow()Skipf(formatstring, args ...any)Skipped()boolTempDir()stringContext()context.Context}TB is testing.TB, to avoid importing "testing" in non-test code.