Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/_pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
if TYPE_CHECKING:
from typing import Type

import pexpect


IGNORE_PAM = [ # filenames added when obtaining details about the current user
"/var/lib/sss/mc/passwd"
Expand Down Expand Up @@ -1240,7 +1242,9 @@ def runpytest_subprocess(self, *args, timeout=None) -> RunResult:
args = self._getpytestargs() + args
return self.run(*args, timeout=timeout)

def spawn_pytest(self, string, expect_timeout=10.0):
def spawn_pytest(
self, string: str, expect_timeout: float = 10.0
) -> "pexpect.spawn":
"""Run pytest using pexpect.

This makes sure to use the right pytest and sets up the temporary
Expand All @@ -1254,7 +1258,7 @@ def spawn_pytest(self, string, expect_timeout=10.0):
cmd = "{} --basetemp={} {}".format(invoke, basetemp, string)
return self.spawn(cmd, expect_timeout=expect_timeout)

def spawn(self, cmd, expect_timeout=10.0):
def spawn(self, cmd: str, expect_timeout: float = 10.0) -> "pexpect.spawn":
"""Run a command using pexpect.

The pexpect child is returned.
Expand Down