0
我使用龍捲風協同程序在python 2.7和我做單元測試,像這樣的:如何對python協同程序進行覆蓋?
def test_my_coroutine_function(self):
# Arranges
...
# Acts
response = yield my_function()
# Asserts
...
我的函數的定義那樣:
@tornado.gen.coroutine
def my_function(self):
a = True
我的問題是,coverage.py告訴我不包括「a = True」這一行。
要使用的覆蓋,我跑以下命令行:
coverage run -m --source=./ unittest discover ./; coverage html;
謝謝您的幫助。