我有一個扭曲的Web資源至極處理傳入的請求,併發送芹菜任務在隊列中進行處理,這芹菜呼叫使用reactor.callInThread 的處理事情是,我想這個單元測試代碼,但因爲在reactor.callInThread代碼永遠不會執行 from twisted.internet.defer import succeed
from twisted.web import server
from tw
通過py.test,我經常生成測試,其中一些測試用例預計會失敗。我如何將它們標記爲xfail?如果我將@py.test.mark.xfail放在測試函數上,則意味着它的所有實例都是xfail。如果我在測試中做py.test.xfail()它實際上不通過測試,不只是將它標記爲xfail。有什麼我可以用metafunc來添加這個標記嗎? 例如 # code - function with a bug
所以,我有以下結構: class Test(object):
def test_1(self):
pass
def test_2(self):
pass
def test_3(self):
pass
它運行太好了,現在我加入了「情景」(因爲它的建議在pytest - A quick port of 「testscenari