[PATCH v3 3/7] dts: filter test suites in executions

Jeremy Spewock jspewock at iol.unh.edu
Tue Feb 27 22:21:56 CET 2024


<snip>
> +
> +        lowercase_suite_to_find = (
> +            f"{self._test_suite_class_prefix}{module_name.replace('_', '')}".lower()
> +        )
> +        for class_name, class_obj in inspect.getmembers(test_suite_module, is_test_suite):
> +            if (
> +                class_name.startswith(self._test_suite_class_prefix)

Is this line required? When we check later if the
lowercase_suite_to_find is equal, we know that this variable we made
starts with the designated prefix because that's just how we made it.
It seems redundant because they could not be equal if the class name
didn't start with the prefix. Is the idea behind this a type of
optimization because this makes us ignore anything that doesn't have
the proper prefix before going further?

>
> +                and lowercase_suite_to_find == class_name.lower()
> +            ):
> +                return class_obj
> +        raise ConfigurationError(
> +            f"Couldn't find any valid test suites in {test_suite_module.__name__}."
> +        )
<snip>


More information about the dev mailing list