Skip to content

Commit a26d994

Browse files
committed
simplify cli as suggested by @max-models
1 parent c7ddfff commit a26d994

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Run unit and short integration tests
3333
run: |
34-
coverage run -p --source=fprettify run_tests.py -s unittests -s builtin -s regular
34+
coverage run -p --source=fprettify run_tests.py -s unittests builtin regular
3535
3636
- name: Run long integration tests
3737
if: ${{ github.event_name == 'schedule' }}

run_tests.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@
3434
help="Reset test results to new results of failed tests")
3535
parser.add_argument("-n", "--name", type=str, help="select tests by name (sections in testsuites.config).")
3636

37-
suite_default = ["unittests", "builtin"]
38-
parser.add_argument("-s", "--suite", type=str, default=suite_default, help="select suite.", choices=["unittests", "builtin", "regular", "cron", "custom"], action='append')
37+
parser.add_argument(
38+
"-s", "--suite",
39+
nargs="+",
40+
choices=["unittests", "builtin", "regular", "cron", "custom"],
41+
default=["unittests", "builtin"],
42+
help="select suite."
43+
)
3944

4045
args = parser.parse_args()
4146

42-
# remove defaults if user has specified anything
43-
if args.suite[:2] == suite_default and len(args.suite) > 2:
44-
args.suite = args.suite[2:]
45-
4647
test_cases = []
4748

4849
if args.name:

0 commit comments

Comments
 (0)