我有一個以迭代方式建立的對象。我想要測試每一個步驟。下面是一個不好的測試功能: def test_object:
o = object.Object()
o.step1() # in place method
assert(o.step1property)
o.step2() # in place method
assert(o.step2prop
請考慮以下情形。 import six
from abc import ABCMeta, abstractmethod
class ThisIsAnAbstractClass(six.with_metaclass(ABCMeta)):
@abstractmethod
def __init__(self,parameter):
self.parameter =
我的配置文件看起來像這樣 # function class,dir, file match this regular expression are considered tests
[NOSE_TESTMATCH]
#by default this is- (?:^|[\b_\./-])[Tt]est
# The file names after this block are ignore