← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #239925]: How do I run a single unittest inside a sikuli script?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
You have to provide the test case name and the test name as user args on
the command line and then in your script have something like that:

The selection of the tests:
suite = unittest.defaultTestLoader.loadTestsFromName(name) or
suite = unittest.defaultTestLoader.loadTestsFromNames((name1, name2, name3)) 

where names are dotted names like
MyTestCase.testXYZ

to customise this use eval like this:

suite = eval("unittest.defaultTestLoader.loadTestsFromName(%s.%s)
"%(myclass, mytest))

where my class, mutest are evaluated from the user args.

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