chore: update test runner to not show traceback if tests fail

This commit is contained in:
Noortheen Raja 2020-11-10 11:07:40 +05:30
parent 8dfcbf1dea
commit 0c2c8d1061
2 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env xonsh
import argparse
import subprocess
from typing import List
@ -7,7 +8,7 @@ $XONSH_DEBUG = 1
$RAISE_SUBPROC_ERROR = True
def _replace_args(args:List[str], num:int) -> List[str]:
def _replace_args(args: List[str], num: int) -> List[str]:
return [
(arg % num) if "%d" in arg else arg
for arg in args
@ -72,4 +73,7 @@ if __name__ == '__main__':
qa_parser.set_defaults(func=qa)
args = parser.parse_args()
args.func(args)
try:
args.func(args)
except subprocess.CalledProcessError as ex:
parser.exit(1, f"Failed with {ex}")

View file

@ -19,8 +19,7 @@ exclude =
feedstock,
rever,
.venv*/,
# remove later
pygments_cache.py
.local.out*/
# lint nits that are acceptable in Xonsh project:
ignore =
D100, # Missing docstring in public module
@ -46,8 +45,7 @@ ignore =
D411, # Missing blank line before section
D407, # Missing dashed underline after section
E122,
# E203 whitespace before ':'
E203,
E203, # whitespace before ':'
E402,
W503, # line break before binary operators is a good thing
E731, # accept lambda assigned to a variable