This commit is contained in:
Kovid Goyal 2022-08-29 10:52:38 +05:30
parent 43b35f6f4e
commit b33a684357
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -163,7 +163,7 @@ def reduce_go_pkgs(module: str, names: Sequence[str]) -> Set[str]:
return go_packages
def run_python_tests(args: Any, go_proc: Optional[subprocess.Popen[bytes]] = None) -> None:
def run_python_tests(args: Any, go_proc: 'Optional[subprocess.Popen[bytes]]' = None) -> None:
tests = find_all_tests()
def print_go() -> None:
@ -197,8 +197,8 @@ def run_tests() -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
'name', nargs='*', default=[],
help='The name of the test to run, for e.g. linebuf corresponds to test_linebuf.'
' Can be specified multiple times. For go tests Something corresponds to TestSometing.')
help='The name of the test to run, for e.g. linebuf corresponds to test_linebuf. Can be specified multiple times.'
' For go tests Something corresponds to TestSometing.')
parser.add_argument('--verbosity', default=4, type=int, help='Test verbosity')
parser.add_argument('--module', default='', help='Name of a test module to restrict to. For example: ssh.'
' For Go tests this is the name of a package, for example: tools/cli')
@ -207,7 +207,7 @@ def run_tests() -> None:
type_check()
go_pkgs = reduce_go_pkgs(args.module, args.name)
if go_pkgs:
go_proc: Optional[subprocess.Popen[bytes]] = run_go(go_pkgs, args.name)
go_proc: 'Optional[subprocess.Popen[bytes]]' = run_go(go_pkgs, args.name)
else:
go_proc = None
with env_for_python_tests():