October 2018
Beginner to intermediate
736 pages
17h 39m
English
A decorator can be thought of as a function that takes another function as an argument, and extends or wraps other functionality around the decorated function without actually modifying it. Any callable—a function, an instance method of a class, or (in this case) a class method belonging to a class—can be used as the decorating function. In this case, the code coverage test case class is going to define two class methods (AddPropertyTesting and AddMethodTesting) using a decorator function structure in order to add new methods (testPropertyCoverage and testMethodCoverage) to any classes that are decorated with them. Those two methods, since they are nested members of the main code coverage class, ...