私はdjango_nose
のNoseTestSuiteRunner
を使ってテストを行っています。現在、テストにdocstringがある場合は、テスト用コンソール(TestCase.ShortDescrption()
)に出力され、None
のテスト名(TestCase.id()
)が印刷されている場合は、TestCase.id()
をTestCase.ShortDescription()
に追加して、TestCase.id docstringの存在。テスト名とモジュールを追加して結果のドキュメントをテストする方法は?
サンプルテスト:代わりに
this is a docstring 1 ... ok
this is a docstring 2 ... Fail
の結果のためにそう
class Foo(unittest.TestCase):
def test_bar_1(self):
""" this is docstring 1"""
pass
def test_bar_2(self):
""" this is docstring 2"""
self.fail()
あなたnosetestsに--with-id
オプションを指定した場合、私は、私は信じてい
test_bar_1(path.to.test.Foo) this is a docstring 1 ... ok
test_bar_2(path.to.test.Foo) this is a docstring 2 ... Fail
これはidによって、私がunittest.TestCase.id()を意味していて、テスト名とパス全体を返すことを意味します。 https://docs.python.org/2/library/unittest.html#unittest.TestCase.id – Mahmor