def spawn(self, cmd, expect_timeout=<NUM_LIT>):
pexpect = pytest.importorskip("<STR_LIT>", "<STR_LIT>")<EOL>if hasattr(sys, "<STR_LIT>") and "<STR_LIT>" in platform.machine():<EOL><INDENT>pytest.skip("<STR_LIT>")<EOL><DEDENT>if sys.platform.startswith("<STR_LIT>"):<EOL><INDENT>pytest.xfail("<STR_LIT>")<EOL><DEDENT>logfile = self.tmpdir.join("<STR_LIT>").open("<STR_LIT:wb>")<EOL>child = pexpect.spawn(cmd, logfile=logfile)<EOL>self.request.addfinalizer(logfile.close)<EOL>child.timeout = expect_timeout<EOL>return child<EOL>
Run a command using pexpect.

        The pexpect child is returned.