Skip to content

Commit 1434b66

Browse files
committed
pytester: spawn: skip without pexpect.spawn
"pexpect" can be imported on Windows, but does not have "pexpect.spawn" then. Ref: https://github.com/pexpect/pexpect/blob/a803933ed53/pexpect/__init__.py#L73-L76
1 parent a24132d commit 1434b66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_pytest/pytester.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,8 @@ def spawn(self, cmd, expect_timeout=10.0):
11881188
pytest.skip("pypy-64 bit not supported")
11891189
if sys.platform.startswith("freebsd"):
11901190
pytest.xfail("pexpect does not work reliably on freebsd")
1191+
if not hasattr(pexpect, "spawn"):
1192+
pytest.skip("pexpect.spawn not available")
11911193
logfile = self.tmpdir.join("spawn.out").open("wb")
11921194

11931195
# Do not load user config.

0 commit comments

Comments
 (0)