I'd rather see case 2 handled using addCleanup:
config.push('test data', test_data) self.addCleanup(config.pop, 'test_data')
In fact, we could even add a helper method to do this:
def pushConfig(self, name, value): config.push(name, value) self.addCleanup(config.pop, name)
I'd rather see case 2 handled using addCleanup:
config. push('test data', test_data) addCleanup( config. pop, 'test_data')
self.
In fact, we could even add a helper method to do this:
def pushConfig(self, name, value):
config. push(name, value)
self.addCleanu p(config. pop, name)