From 4db65b0b5c31e5fc971f40f41051023aecc22b99 Mon Sep 17 00:00:00 2001 From: xumingkuan Date: Thu, 16 Jul 2020 00:01:13 -0400 Subject: [PATCH] [cli] Fix "AttributeError" of pytest arguments (#1505) --- python/taichi/main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/taichi/main.py b/python/taichi/main.py index 44613f830ad7c..c4e06a4001659 100644 --- a/python/taichi/main.py +++ b/python/taichi/main.py @@ -715,19 +715,19 @@ def _test_python(args): pytest_args += ['-s', '-v'] if args.rerun: pytest_args += ['--reruns', args.rerun] - if args.keys: - pytest_args += ['-k', args.keys] - if args.marks: - pytest_args += ['-m', args.marks] - if args.failed_first: - pytest_args += ['--failed-first'] - if args.fail_fast: - pytest_args += ['--exitfirst'] try: if args.coverage: pytest_args += ['--cov-branch', '--cov=python/taichi'] if args.cov_append: pytest_args += ['--cov-append'] + if args.keys: + pytest_args += ['-k', args.keys] + if args.marks: + pytest_args += ['-m', args.marks] + if args.failed_first: + pytest_args += ['--failed-first'] + if args.fail_fast: + pytest_args += ['--exitfirst'] except AttributeError: pass