Run a command using pexpect. The pexpect child is returned.
(self, cmd: str, expect_timeout: float = 10.0)
| 1535 | return self.spawn(cmd, expect_timeout=expect_timeout) |
| 1536 | |
| 1537 | def spawn(self, cmd: str, expect_timeout: float = 10.0) -> pexpect.spawn: |
| 1538 | class="st">"""Run a command using pexpect. |
| 1539 | |
| 1540 | The pexpect child is returned. |
| 1541 | class="st">""" |
| 1542 | pexpect = importorskip(class="st">"pexpect", class="st">"3.0") |
| 1543 | if hasattr(sys, class="st">"pypy_version_info") and class="st">"64" in platform.machine(): |
| 1544 | skip(class="st">"pypy-64 bit not supported") |
| 1545 | if not hasattr(pexpect, class="st">"spawn"): |
| 1546 | skip(class="st">"pexpect.spawn not available") |
| 1547 | logfile = self.path.joinpath(class="st">"spawn.out").open(class="st">"wb") |
| 1548 | |
| 1549 | child = pexpect.spawn(cmd, logfile=logfile, timeout=expect_timeout) |
| 1550 | self._request.addfinalizer(logfile.close) |
| 1551 | return child |
| 1552 | |
| 1553 | |
| 1554 | class LineComp: |
no test coverage detected