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