(self)
| 4560 | f = None |
| 4561 | |
| 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): |
| 4571 | print("Oops!") |
| 4572 | |
| 4573 | def test_vicious_descriptor_nonsense(self): |
| 4574 | # Testing vicious_descriptor_nonsense... |
nothing calls this directly
no test coverage detected