Python Unit Test Automation



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

Listing 4-11.  nosetests.xml





Creating an HTML Report
nose does not have a built-in provision for HTML reports. You have to install a plugin for 
that. Run the following command to install the HTML output plugin:
sudo pip3 install nose-htmloutput
Once the plugin is installed, you can run the following command to execute the test:
nosetests test_module01.py -vs --with-html
Here is the output:
In setUpPackage()...
test.test_module01.test_case01 ... ok
In tearDownPackage()...
----------------------------------------------------------------------
HTML: nosetests.html
----------------------------------------------------------------------
Ran 1 test in 0.009s
OK
The plugin saves the output in the current location in a file called nosetests.html. 
Figure 
4-3
 shows a snapshot of the nosetests.html file, opened in a web browser.


Chapter 4 

 nose and nose2
82
Creating Color Output in the Console
Until now, you saw the methods that generate formatted output files. While running 
nosetest, you must have observed that the console output is monochrome (white text on 
a dark background and vice versa). The plugin called rednose is used to create colored 
console output. You can install that plugin using the following command:
sudo pip3 install rednose
Once the plugin is installed, run the following command:
nosetests test_module08.py -vs --rednose
Figure 
4-4
 shows a screenshot of the output, although you won’t see it in color here, 
due to the grayscale nature of the published book.

Download 1,71 Mb.

Do'stlaringiz bilan baham:
1   ...   49   50   51   52   53   54   55   56   ...   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