Run pytest using pexpect. This makes sure to use the right pytest and sets up the temporary directory locations. The pexpect child is returned.
(
self, string: str, expect_timeout: float = 10.0
)
| 1472 | return self.run(*args, timeout=timeout) |
| 1473 | |
| 1474 | def spawn_pytest( |
| 1475 | self, string: str, expect_timeout: float = 10.0 |
| 1476 | ) -> "pexpect.spawn": |
| 1477 | """Run pytest using pexpect. |
| 1478 | |
| 1479 | This makes sure to use the right pytest and sets up the temporary |
| 1480 | directory locations. |
| 1481 | |
| 1482 | The pexpect child is returned. |
| 1483 | """ |
| 1484 | basetemp = self.path / "temp-pexpect" |
| 1485 | basetemp.mkdir(mode=0o700) |
| 1486 | invoke = " ".join(map(str, self._getpytestargs())) |
| 1487 | cmd = f"{invoke} --basetemp={basetemp} {string}" |
| 1488 | return self.spawn(cmd, expect_timeout=expect_timeout) |
| 1489 | |
| 1490 | def spawn(self, cmd: str, expect_timeout: float = 10.0) -> "pexpect.spawn": |
| 1491 | """Run a command using pexpect. |
no test coverage detected