Report full version in check-ast

This commit is contained in:
Anthony Sottile 2017-07-05 12:38:21 -07:00
parent a574f8cb2b
commit 8ad9e7c94c
3 changed files with 8 additions and 6 deletions

View file

@ -10,6 +10,8 @@ omit =
get-git-lfs.py
[report]
show_missing = True
skip_covered = True
exclude_lines =
# Have to re-enable the standard pragma
\#\s*pragma: no cover

View file

@ -4,7 +4,7 @@ from __future__ import unicode_literals
import argparse
import ast
import os.path
import platform
import sys
import traceback
@ -14,16 +14,16 @@ def check_ast(argv=None):
parser.add_argument('filenames', nargs='*')
args = parser.parse_args(argv)
_, interpreter = os.path.split(sys.executable)
retval = 0
for filename in args.filenames:
try:
ast.parse(open(filename, 'rb').read(), filename=filename)
except SyntaxError:
print('{}: failed parsing with {}:'.format(
filename, interpreter,
print('{}: failed parsing with {} {}:'.format(
filename,
platform.python_implementation(),
sys.version.partition(' ')[0],
))
print('\n{}'.format(
' ' + traceback.format_exc().replace('\n', '\n ')

View file

@ -14,7 +14,7 @@ setenv =
commands =
coverage erase
coverage run -m pytest {posargs:tests}
coverage report --show-missing --fail-under 100
coverage report --fail-under 100
pre-commit install -f --install-hooks
pre-commit run --all-files