我有一个测试函数来操纵对象的内部状态。该对象使用logging.info()记录以下内容。 INFO:root:_change: test light red
INFO:root:_change: test light green
INFO:root:_change: test light yellow
我怎样才能将它纳入鼻子或unittest功能,以便我可以有一个类似的测试呢? def
Zed A. shaw的书“Learn python the hard way”(第3版)。我是一个Python的新手和学习python 。 我试图运行nosetests命令,但它什么都不做,而是显示了一些错误消息(如附图所示)。 Link to the exercise 能否请你帮我做什么? 在此先感谢。 错误:
当在测试设置中有重大的重叠时,它可以让事情继续使用继承。但是,这会造成一些问题与测试执行的不必要的重复: from unittest import TestCase
class TestPotato(TestCase):
def test_in_parent(self):
print 'in parent'
class TestSpud(TestPotato):