Make a valid python temp file.
(self)
| 138 | |
| 139 | class SubProcessTestCase(tt.TempFileMixin): |
| 140 | def setUp(self): |
| 141 | """Make a valid python temp file.""" |
| 142 | lines = [ |
| 143 | "import sys", |
| 144 | "print('on stdout', end='', file=sys.stdout)", |
| 145 | "print('on stderr', end='', file=sys.stderr)", |
| 146 | "sys.stdout.flush()", |
| 147 | "sys.stderr.flush()", |
| 148 | ] |
| 149 | self.mktmp("\n".join(lines)) |
| 150 | |
| 151 | def test_system(self): |
| 152 | status = system(f'{python} "{self.fname}"') |