def setUp(self):
self.lc = LogCapture()
self.lc.setLevel(logging.DEBUG)
self.lc.addFilter(test_common.MyLogCaptureFilter())
self.additional_setup()
self.addCleanup(self.cleanup)
self.old_handle_spec = vpc.handle_spec
# Monkey patch the handle_spec function, which is called by the
# watcher. The handle_spec function is defined in the VPC module.
# However, it was directly imported by the watcher module, so it's now
# a copy in the watcher module namespace. Thus, the patch has to be
# done actually in the watcher module. For safety, we'll do it in both
# the vpc and watcher module.
def new_handle_spec(*args, **kwargs):
pass
watcher.handle_spec = vpc.handle_spec = new_handle_spec
评论列表
文章目录