Testleri çalıştırmak için django_nose
's NoseTestSuiteRunner
kullanıyorum. Şu anda testin docstring'i varsa, test için konsolda (TestCase.ShortDescrption()
) basılacak ve testin (TestCase.id()
) None
adı yazılıyorsa, TestCase.id()
TestCase.ShortDescription()
'a eklemek istiyorum, böylece TestCase.id() Docstring'in varlığı.Test adı ve modül nasıl eklenir?
örnek testi: yerine
this is a docstring 1 ... ok
this is a docstring 2 ... Fail
sonucu için çok
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()
Eğer nosetests için --with-id
seçeneği vermeniz durumunda İnanıyorum
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
Bu bir id ekleyecektir, ben tüm test adını ve yolunu döndüren unittest.TestCase.id() anlamına gelir. https://docs.python.org/2/library/unittest.html#unittest.TestCase.id – Mahmor