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

Function TestSuiteLogging

suite/suite_test.go:455–479  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

453}
454
455func TestSuiteLogging(t *testing.T) {
456 suiteLoggingTester := new(SuiteLoggingTester)
457 capture := StdoutCapture{}
458 internalTest := testing.InternalTest{
459 Name: t.Name() + "/SuiteLoggingTester",
460 F: func(subT *testing.T) {
461 Run(subT, suiteLoggingTester)
462 },
463 }
464 capture.StartCapture()
465 testing.RunTests(allTestsFilter, []testing.InternalTest{internalTest})
466 output, err := capture.StopCapture()
467 require.NoError(t, err, "Got an error trying to capture stdout and stderr!")
468 require.NotEmpty(t, output, "output content must not be empty")
469
470 // Failed tests' output is always printed
471 assert.Contains(t, output, "TESTLOGFAIL")
472
473 if testing.Verbose() {
474 // In verbose mode, output from successful tests is also printed
475 assert.Contains(t, output, "TESTLOGPASS")
476 } else {
477 assert.NotContains(t, output, "TESTLOGPASS")
478 }
479}
480
481type CallOrderSuite struct {
482 Suite

Callers

nothing calls this directly

Calls 8

StartCaptureMethod · 0.95
StopCaptureMethod · 0.95
NoErrorFunction · 0.92
NotEmptyFunction · 0.92
ContainsFunction · 0.92
NotContainsFunction · 0.92
RunFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected