(self, separate_stderr=False)
| 170 | |
| 171 | @contextlib.contextmanager |
| 172 | def interactive_python(self, separate_stderr=False): |
| 173 | if separate_stderr: |
| 174 | p = spawn_python('-i', stderr=subprocess.PIPE) |
| 175 | stderr = p.stderr |
| 176 | else: |
| 177 | p = spawn_python('-i', stderr=subprocess.STDOUT) |
| 178 | stderr = p.stdout |
| 179 | try: |
| 180 | # Drain stderr until prompt |
| 181 | while True: |
| 182 | data = stderr.read(4) |
| 183 | if data == b">>> ": |
| 184 | break |
| 185 | stderr.readline() |
| 186 | yield p |
| 187 | finally: |
| 188 | kill_python(p) |
| 189 | stderr.close() |
| 190 | |
| 191 | def check_repl_stdout_flush(self, separate_stderr=False): |
| 192 | with self.interactive_python(separate_stderr) as p: |
no test coverage detected