Python Unit Test Automation



Download 1,71 Mb.
Pdf ko'rish
bet54/73
Sana31.12.2021
Hajmi1,71 Mb.
#213720
1   ...   50   51   52   53   54   55   56   57   ...   73
Bog'liq
2 5188215245394412341

Figure 4-3.  The nosetests.html file


Chapter 4 

 nose and nose2
83
Running unittest Tests from nose
In the beginning of the chapter, you read that you can run unittest tests with nose. 
Let’s try that now. Navigate to the chapter03 directory. Run the following command to 
discover and execute all of the unittest tests automatically:
nosetests -v
This will be the output:
test_case01 (test.test_module01.TestClass01) ... ok
test_case02 (test.test_module01.TestClass01) ... ok
test_case01 (test.test_module02.TestClass02) ... ok
test_case02 (test.test_module02.TestClass02) ... ok
test_case01 (test.test_module03.TestClass03) ... ok
test_case02 (test.test_module03.TestClass03) ... ok
test_case03 (test.test_module03.TestClass03) ... FAIL
test_case04 (test.test_module03.TestClass03) ... FAIL
test_case01 (test.test_module04.TestClass04) ... ok
I am truncating the output as it would otherwise fill a lot of pages. Run the command 
yourself to see the entire output.
Advantages of nose over unittest
Here is a summary of the advantages of nose over unittest:
 Unlike unittest, nose does not require you to extend test cases 
from a parent class. This results in less code.
 Using nose, you can write test functions. This is not possible in 
unittest.

Download 1,71 Mb.

Do'stlaringiz bilan baham:
1   ...   50   51   52   53   54   55   56   57   ...   73




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish