MCPcopy Create free account
hub / github.com/RustPython/RustPython / StdoutGuard

Class StdoutGuard

Lib/test/test_descr.py:4564–4567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4562 def test_file_fault(self):
4563 # Testing sys.stdout is changed in getattr...
4564 class StdoutGuard:
4565 def __getattr__(self, attr):
4566 sys.stdout = sys.__stdout__
4567 raise RuntimeError(f"Premature access to sys.stdout.{attr}")
4568
4569 with redirect_stdout(StdoutGuard()):
4570 with self.assertRaises(RuntimeError):

Callers 1

test_file_faultMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_file_faultMethod · 0.68