HTMLTestRunner Import error

Asked by Heraclis

I have read multiple questions regarding the subject. In the past I had this working on another pc, but now I cannot find solution so I am begging for help :)

I downloaded the HTMLTestRunner as suggested and put the HTMLTestRunner.py inside the .sikuli folder. My sikuli script looks like:

import unittest
import HTMLTestRunner

class BDTests(self):
    def testAOpenBrowser(self):
        import launchchrome
        print("Open chrome done!")

suite = unittest.TestLoader().loadTestsFromTestCase(BDTests)
outfile = open("C:\\Users\\eraclis\\Documents\\Reports\\results.html","w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile,title='Test Report demo',description='Test description')
runner.run(suite)

Now when I try to run it I am getting:
[error] script [ testRunner ] stopped with error in line 2
[error] ImportError ( No module named HTMLTestRunner )

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Heraclis
Solved:
Last query:
Last reply:
Revision history for this message
Heraclis (eraclis) said :
#1

I found my mistake. HTMLTestReport was added inside.sikuli while it needed to be in same folder with .sikuli

Revision history for this message
RaiMan (raimund-hocke) said :
#2

Yep. Currently it is generally not recommended to put something into a .sikuli yourself anyway.