← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #199493]: HTMLTestRunner Not producing a report

 

Question #199493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/199493

    Status: Open => Answered

RaiMan proposed the following answer:
Looking again at your code, I normally do it this way (hope there are
some typos in your listing ;-)

from sikuli.Sikuli import*
import HTMLTestRunner
import unittest

class Test(unittest.TestCase):
# class names should start uppercase

    def setUp(self):

    def tearDown(self):

    def test1(self):

    def test2(self):

# the above def's contain some code I guess ;-)

#import sys;sys.argv = ['', 'Test.testName']

suite = unittest.TestLoader().loadTestsFromTestCase(Test)

# I thought you want to run the HTMLTestRunner 
# unittest.TextTestRunner(verbosity=2).run(suite)

outfile = open(r"C:\Report.html", "w")
# double \ or raw string r""

runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
runner.run(suite)

outfile.close()

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.