【发布时间】:2018-09-25 23:09:47
【问题描述】:
我的代码使用下面的代码生成一个警报/消息框。
import win32api
win32api.MessageBox(0, 'You have reached the end of the data.', 'End of Data')
有没有办法测试消息是否出现,例如类似assert appears?理想情况下,我想使用 PyTest 来做到这一点,但是仍然非常感谢使用其他框架的解决方案。测试框中的文本也很好,例如assert message == "You have reached the end of the data."
【问题讨论】:
-
如果您需要有关我给出的答案的更多信息,请告诉我...
标签: python unit-testing testing pytest pywin32