Am 14.01.2021 um 08:38 hat Vladimir Sementsov-Ogievskiy geschrieben: > 12.01.2021 19:42, Kevin Wolf wrote: > > > + def find_tests(self, groups: Optional[List[str]] = None, > > > + exclude_groups: Optional[List[str]] = None, > > > + tests: Optional[List[str]] = None, > > group and tests seem to be read-only, so this can be simplified to > > 'groups: Sequence[str] = ()' etc. without the explicit handling of None > > below. > > None comes when cmdline argument is not set, will sequence as you propose I > get > > Traceback (most recent call last): > File "/work/src/qemu/up-refactor-iotests/build/tests/qemu-iotests/./check", > line 37, in <module> > tests, remaining_argv = find_tests(env.remaining_argv, > File "/work/src/qemu/up-refactor-iotests/tests/qemu-iotests/findtests.py", > line 208, in find_tests > return tf.find_tests_argv(argv) > File "/work/src/qemu/up-refactor-iotests/tests/qemu-iotests/findtests.py", > line 193, in find_tests_argv > return self.find_tests(**vars(args)), remaining > File "/work/src/qemu/up-refactor-iotests/tests/qemu-iotests/findtests.py", > line 165, in find_tests > if 'disabled' not in groups and 'disabled' not in exclude_groups: > TypeError: argument of type 'NoneType' is not iterable > > So, seems simpler to keep all as is than modifying find_tests_argv to not > pass None arguments.
Ah, I wasn't aware that you would get explicit None. Fair enough. Kevin