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
This commit is contained in:
Daniel Hahler 2019-08-13 17:54:40 +02:00
parent a24132ddc5
commit 1434b66c35
1 changed files with 2 additions and 0 deletions

View File

@ -1188,6 +1188,8 @@ class Testdir:
pytest.skip("pypy-64 bit not supported")
if sys.platform.startswith("freebsd"):
pytest.xfail("pexpect does not work reliably on freebsd")
if not hasattr(pexpect, "spawn"):
pytest.skip("pexpect.spawn not available")
logfile = self.tmpdir.join("spawn.out").open("wb")
# Do not load user config.