MCPcopy
hub / github.com/stas00/ml-engineering / __exit__

Method __exit__

testing/testing_utils.py:433–448  ·  view source on GitHub ↗
(self, *exc)

Source from the content-addressed store, hash-verified

431 return self
432
433 def __exit__(self, *exc):
434 if self.out_buf is not None:
435 sys.stdout = self.out_old
436 captured = self.out_buf.getvalue()
437 if self.replay:
438 sys.stdout.write(captured)
439 self.out = apply_print_resets(captured)
440 self.combined += self.out
441
442 if self.err_buf is not None:
443 sys.stderr = self.err_old
444 captured = self.err_buf.getvalue()
445 if self.replay:
446 sys.stderr.write(captured)
447 self.err = captured
448 self.combined += self.err
449
450 def __repr__(self):
451 msg = ""

Callers

nothing calls this directly

Calls 2

apply_print_resetsFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected