(self)
| 4779 | f = None |
| 4780 | |
| 4781 | def test_file_fault(self): |
| 4782 | # Testing sys.stdout is changed in getattr... |
| 4783 | class StdoutGuard: |
| 4784 | def __getattr__(self, attr): |
| 4785 | sys.stdout = sys.__stdout__ |
| 4786 | raise RuntimeError(f"Premature access to sys.stdout.{attr}") |
| 4787 | |
| 4788 | with redirect_stdout(StdoutGuard()): |
| 4789 | with self.assertRaises(RuntimeError): |
| 4790 | print("Oops!") |
| 4791 | |
| 4792 | def test_vicious_descriptor_nonsense(self): |
| 4793 | # Testing vicious_descriptor_nonsense... |
nothing calls this directly
no test coverage detected