Skip to content

Commit

Permalink
Fix release_test.tests.__all__
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Ritchford committed Oct 13, 2018
1 parent d265982 commit 2e7365a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
17 changes: 7 additions & 10 deletions scripts/release_test/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
def arguments(argv=sys.argv[1:]):
parser = argparse.ArgumentParser()

names = [t.__name__.split('.')[1] for t in tests.__all__]
names = ', '.join(names)
names = ', '.join(tests.__all__)

parser.add_argument(
'tests', nargs='*',
Expand All @@ -24,14 +23,12 @@ def arguments(argv=sys.argv[1:]):

args = parser.parse_args(argv)

if args.tests:
all_tests = [(t, getattr(tests, t, None)) for t in args.tests]
bad_tests = [t for (t, a) in all_tests if a is None]
if bad_tests:
raise ValueError('Bad test names: ' + ', '.join(bad_tests))
all_tests = tuple(a for (t, a) in all_tests)
else:
all_tests = tests.__all__
test_list = args.tests or tests.__all__
all_tests = [(t, getattr(tests, t, None)) for t in test_list]
bad_tests = [t for (t, a) in all_tests if a is None]
if bad_tests:
raise ValueError('Bad test names: ' + ', '.join(bad_tests))
all_tests = tuple(a for (t, a) in all_tests)

if args.features:
features = set(':'.join(args.features).split(':'))
Expand Down
3 changes: 2 additions & 1 deletion scripts/release_test/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import (
new, unit, simpixel, rest, remote, keyboard, j12k, midi, all_pixel, bp)

__all__ = new, unit, simpixel, keyboard, rest, midi, j12k, bp, all_pixel, remote
__all__ = ['new', 'unit', 'simpixel', 'keyboard', 'rest', 'midi', 'j12k', 'bp',
'all_pixel', 'remote']

0 comments on commit 2e7365a

Please sign in to comment.