单元,功能,验收和集成测试(以及我未提及的任何其他类型的测试)之间有什么区别?
我在类和以下方法中有一个中断处理程序:
def interruptHandler(self, signal, frame):
""" Catches SIGINT and SIGTERM to allow proper shutdown of all threads etc."""
self.stopWorker()
print("interrupt") # the print message is just for me to see if it works
Run Code Online (Sandbox Code Playgroud)
当我按 control + c 时,我从中断处理程序中收到打印消息,因此该方法很好。但是当我为它编写 pytest 时,我不知道如何断言 SIGINT。当我想强制中断时
worker.interruptHandler(signal.sigint)
我收到一个错误,提示我缺少参数框架。