Identifying missing test methods

The inspect.getmembers function that was used to identify classes in modules earlier can also be used to identify other member types of other target elements, such as properties and methods of classes. The process for identifying either is similar to what's already been shown for identifying classes in modules, and looks like this (for properties):

target_class = target_module.Parent

target_properties = set([
    member[0] for member in 
    inspect.getmembers(target_class, inspect.isdatadescriptor)
])
# target_properties = {'__weakref__'}

The only significant differences here from the process for finding classes in a module are the target that's being inspected (in this case, the target_class, which we've ...

Get Hands-On Software Engineering with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.