← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #192601]: Unittest - unable to start the application from setup

 

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

    Status: Answered => Open

Prem Nambiar is still having a problem:
Hi RaiMan,

That is funny!
Sorry I should have been more careful.

Appreciate your help and being patient at my stupid mistake.

Regards,
/Prem


On Wed, Apr 4, 2012 at 5:50 PM, RaiMan <question192601@xxxxxxxxxxxxxxxxxxxxx
> wrote:

> Your question #192601 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/192601
>
> Description changed to:
> **** setup function in class TestCase is named
>
> setUp() # uppercase u
>
> -------------------------------------------------
>
> In unittest unable to start the application from setup but same code
> works in tes1. Not sure what i am doing wrong. Here is the code snippet
>
> dir = "c:/SikuliScripts/HTMLTestRunner"
> import os
> fp = file(os.path.join(dir, "AViewTest.html"), "wb")
>
> import unittest
> import HTMLTestRunner
> reload(HTMLTestRunner)
>
> class MyTest1(unittest.TestCase):
>    def setup(self):
>        #aview = App(r'C:/Files/Classroom/Classroom.exe')   # not able to
> start the app
>        #aview.open()
>        wait(5)
>    def test1(self):
>        aview = App(r'C:/Files/Classroom/Classroom.exe')   # same scripts I
> can run from here
>        aview.open()
> class MyTest2(unittest.TestCase):
>    def test1(self):
>        assert False
>
> suite = unittest.TestLoader().loadTestsFromTestCase(MyTest1)
> suite.addTests(unittest.TestLoader().loadTestsFromTestCase(MyTest2))
> runner = HTMLTestRunner.HTMLTestRunner(stream = fp, verbosity=2,
> dirTestScreenshots = dir)
> runner.run(suite)
> fp.close()
>
> --
> You received this question notification because you asked the question.
>

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