Skip to content

Commit 5ec11f5

Browse files
committed
tests/run-tests: Factor out list supported external boards.
To get consistent error messages, etc.
1 parent 88153dc commit 5ec11f5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/run-tests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,15 @@ def main():
351351
cmd_parser.add_argument('files', nargs='*', help='input test files')
352352
args = cmd_parser.parse_args()
353353

354-
if args.target in ('pyboard', 'wipy', 'esp8266'):
354+
EXTERNAL_TARGETS = ('pyboard', 'wipy', 'esp8266')
355+
if args.target in EXTERNAL_TARGETS:
355356
import pyboard
356357
pyb = pyboard.Pyboard(args.device, args.baudrate, args.user, args.password)
357358
pyb.enter_raw_repl()
358359
elif args.target == 'unix':
359360
pyb = None
360361
else:
361-
raise ValueError('target must be either unix, pyboard or wipy')
362+
raise ValueError('target must be either %s or unix' % ", ".join(EXTERNAL_TARGETS))
362363

363364
if len(args.files) == 0:
364365
if args.test_dirs is None:

0 commit comments

Comments
 (0)