简体   繁体   中英

How to start python unit tests from command line with Sikuli 1.0.1

I have some tests, which were running from command line interface with -t parameter, which seems not to be supported with 1.0.1 any more.

The tests look like:

import unittest
import HTMLTestRunner

class TestSeqFunc(unittest.TestCase):  

  def test1(self):
    click("a.png")
    assert True

  def test2(self):
    click("a.png")
    assert False

suite = unittest.TestLoader().loadTestsFromTestCase(TestSeqFunc)
outfile = open("/Users/vinogradov/Documents/Report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title="Test Report", description="Test1")
runner.run(suite)

How could I start them, using Sikuli 1.0.1 (with Mac OS X, but the question is general).

Self-service:

Just put HTMLTestRunner.py inside .sikuli package then run with -r, not with -t:

In my case:

/Applications/SikuliX-IDE.app/Contents/runIDE -r test.sikuli

works perfectly!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM