Consider module_utils deps when running tests. (#21382)

* Skip pep8 analysis when --explain is used.
* Fix return type annotations.
* Match line length requirement of PEP 8 config.
* Consider module_utils deps when running tests.
This commit is contained in:
Matt Clay 2017-02-13 18:49:36 -08:00 committed by GitHub
parent f2729f11c3
commit d54bc09fae
6 changed files with 229 additions and 37 deletions

View file

@ -165,7 +165,7 @@ def generate_egg_info(args):
def generate_pip_install(command):
"""
:type command: str
:return: list[str] | None
:rtype: list[str] | None
"""
constraints = 'test/runner/requirements/constraints.txt'
requirements = 'test/runner/requirements/%s.txt' % command
@ -861,6 +861,9 @@ def command_sanity_pep8(args, targets):
if stderr:
raise SubprocessError(cmd=cmd, status=status, stderr=stderr)
if args.explain:
return
pattern = '^(?P<path>[^:]*):(?P<line>[0-9]+):(?P<column>[0-9]+): (?P<code>[A-Z0-9]{4}) (?P<message>.*)$'
results = [re.search(pattern, line).groupdict() for line in stdout.splitlines()]