(self)
| 339 | return self |
| 340 | |
| 341 | def start(self) -> None: |
| 342 | # Start the process and capture its stdout/stderr output to a temp |
| 343 | # file. We do this instead of using subprocess.PIPE (which causes the |
| 344 | # Popen object to capture the output to its own internal buffer), |
| 345 | # because large amounts of output can cause it to deadlock. |
| 346 | self._stdout_file = TemporaryFile("w+", encoding="utf-8") |
| 347 | print(f"Running: {shlex.join(self.args)}") |
| 348 | self._proc = subprocess.Popen( |
| 349 | self.args, |
| 350 | cwd=self.cwd, |
| 351 | stdout=self._stdout_file, |
| 352 | stderr=subprocess.STDOUT, |
| 353 | text=True, |
| 354 | env={**os.environ.copy(), **self.env}, |
| 355 | ) |
| 356 | |
| 357 | def __exit__( |
| 358 | self, |
no test coverage detected