(self)
| 171 | # CRASHES asfd(NULL) |
| 172 | |
| 173 | def test_pyfile_newstdprinter(self): |
| 174 | # Test PyFile_NewStdPrinter() |
| 175 | pyfile_newstdprinter = _testcapi.pyfile_newstdprinter |
| 176 | |
| 177 | file = pyfile_newstdprinter(STDOUT_FD) |
| 178 | self.assertEqual(file.closed, False) |
| 179 | self.assertIsNone(file.encoding) |
| 180 | self.assertEqual(file.mode, "w") |
| 181 | |
| 182 | self.assertEqual(file.fileno(), STDOUT_FD) |
| 183 | self.assertEqual(file.isatty(), os.isatty(STDOUT_FD)) |
| 184 | |
| 185 | # flush() is a no-op |
| 186 | self.assertIsNone(file.flush()) |
| 187 | |
| 188 | # close() is a no-op |
| 189 | self.assertIsNone(file.close()) |
| 190 | self.assertEqual(file.closed, False) |
| 191 | |
| 192 | support.check_disallow_instantiation(self, type(file)) |
| 193 | |
| 194 | def test_pyfile_newstdprinter_write(self): |
| 195 | # Test the write() method of PyFile_NewStdPrinter() |
nothing calls this directly
no test coverage detected