On Tue, May 14, 2024 at 1:30 PM Luca Vizzarro <luca.vizza...@arm.com> wrote: > > On 13/05/2024 17:02, Juraj Linkeš wrote: > >> def _filter_test_cases( > >> self, test_suite_class: type[TestSuite], test_cases_to_run: > >> Sequence[str] > >> - ) -> tuple[list[MethodType], list[MethodType]]: > >> + ) -> tuple[list[FunctionType], list[FunctionType]]: > > > > Does changing inspect.getmembers(test_suite_class, inspect.isfunction) > > to use inspect.ismethod not work? > > Nope, for some reason when running inspect.ismethod on the TestSuite > class methods it returns False... I didn't investigate further, as just > isfunction works and it's not a deal breaker.
I looked a bit into this and ismethod() returns True for instance methods (the function knows the instance it's bound to) and we're working with class members (in this case, there's no instance associated with the function, so it actually can't be a method), so we have to use isfunction() and as such the change to FunctionType is the proper one.