...
This commit is contained in:
parent
43b35f6f4e
commit
b33a684357
@ -163,7 +163,7 @@ def reduce_go_pkgs(module: str, names: Sequence[str]) -> Set[str]:
|
|||||||
return go_packages
|
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()
|
tests = find_all_tests()
|
||||||
|
|
||||||
def print_go() -> None:
|
def print_go() -> None:
|
||||||
@ -197,8 +197,8 @@ def run_tests() -> None:
|
|||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'name', nargs='*', default=[],
|
'name', nargs='*', default=[],
|
||||||
help='The name of the test to run, for e.g. linebuf corresponds to test_linebuf.'
|
help='The name of the test to run, for e.g. linebuf corresponds to test_linebuf. Can be specified multiple times.'
|
||||||
' Can be specified multiple times. For go tests Something corresponds to TestSometing.')
|
' For go tests Something corresponds to TestSometing.')
|
||||||
parser.add_argument('--verbosity', default=4, type=int, help='Test verbosity')
|
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.'
|
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')
|
' For Go tests this is the name of a package, for example: tools/cli')
|
||||||
@ -207,7 +207,7 @@ def run_tests() -> None:
|
|||||||
type_check()
|
type_check()
|
||||||
go_pkgs = reduce_go_pkgs(args.module, args.name)
|
go_pkgs = reduce_go_pkgs(args.module, args.name)
|
||||||
if go_pkgs:
|
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:
|
else:
|
||||||
go_proc = None
|
go_proc = None
|
||||||
with env_for_python_tests():
|
with env_for_python_tests():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user