我有一个通过HTTP调用远程服务的类。现在,这个类检测它是否在“TESTING”模式下运行并相应地操作:虽然“TESTING”不向远程服务发送实际的请求,但它只返回而不执行任何操作。在
class PushService(object):
def trigger_event(self, channel_name, event_name, data):
if satnet_cfg.TESTING:
logger.warning('[push] Service is in testing mode')
return
self._service.trigger(channel_name, event_name, data)
几个测试调用部分代码,最后通过调用此方法结束。我的问题如下:
^{pr2}$
如果需要对所有测试执行修补程序,可以使用^{{cd1>}方法执行此操作:
^{cd1>}每类调用一次(本例中为测试套件)。在这个方法中,您可以设置所有测试都需要使用的修补程序。
相关问题 更多 >
编程相关推荐