MCPcopy
hub / github.com/docker/compose / saveGlobalState

Function saveGlobalState

cmd/compose/compose_progress_test.go:39–47  ·  view source on GitHub ↗

saveGlobalState snapshots package-level state that selectEventProcessor mutates (display.Mode and, in JSON mode, the logrus standard formatter) and restores it on test cleanup.

(t *testing.T)

Source from the content-addressed store, hash-verified

37// mutates (display.Mode and, in JSON mode, the logrus standard formatter)
38// and restores it on test cleanup.
39func saveGlobalState(t *testing.T) {
40 t.Helper()
41 originalMode := display.Mode
42 originalFormatter := logrus.StandardLogger().Formatter
43 t.Cleanup(func() {
44 display.Mode = originalMode
45 logrus.SetFormatter(originalFormatter)
46 })
47}
48
49// newStream returns a *streams.Out whose IsTerminal() matches tty. When tty is
50// true it is backed by a pseudo-terminal slave; otherwise by an os.Pipe writer.

Calls

no outgoing calls

Tested by

no test coverage detected