testoutput

package
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package testoutput provides SuppressIfPasses function that mutes output of the test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SuppressIfPasses

func SuppressIfPasses(t *testing.T)

SuppressIfPasses immediately mutes output (to both STDOUT and STDERR) of the test so that the output will only be shown if the test fails. The cleanup part is scheduled to be run automatically, no need to clean up manually.

Note: This function will only work when the test is not run in parallel within the test binary, i.e. when the test (or its parents) haven't called t.Parallel(), otherwise it will panic. After the output is suppressed, t.Parallel() for the test will panic.

Note: This function does nothing if the test is run in verbose mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

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