MCPcopy
hub / github.com/stretchr/testify / StopCapture

Method StopCapture

suite/suite_test.go:442–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440}
441
442func (sc *StdoutCapture) StopCapture() (string, error) {
443 if sc.oldStdout == nil || sc.readPipe == nil {
444 return "", errors.New("StartCapture not called before StopCapture")
445 }
446 os.Stdout.Close()
447 os.Stdout = sc.oldStdout
448 bytes, err := io.ReadAll(sc.readPipe)
449 if err != nil {
450 return "", err
451 }
452 return string(bytes), nil
453}
454
455func TestSuiteLogging(t *testing.T) {
456 suiteLoggingTester := new(SuiteLoggingTester)

Callers 1

TestSuiteLoggingFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected