[TIP] Meta-test methods...
dgou at mac.com
Mon Apr 27 08:18:26 PDT 2009
Early this morning, in a low-caffeine-stupor, I wrote:
>However, right now we have something akin to:
>def reset_and_voltage_test(self, reset_action, voltage_level):
> # return a function that will test the given
> # reset_action and voltage_level combination interactions.
># Using a new naming convention for meta-test-methods:
> return [self.reset_and_voltage_test(reset_action, voltage_level)
> for reset_action in self.reset_actions()
> for voltage_level in self.voltage_levels()]
That was the "after" example, how we -might- use a meta-method.
The "before" example is, what we do now and need to fix:
for reset_action in self.reset_actions():
for voltage_level in self.voltage_levels():
# and yes, in the current/"before" code, the worker function does the work, in the potential/"after" code, the worker function returns a function that does the work. :)
-Doug (now with more wakefulness!)
More information about the testing-in-python