unittest and pycharm debugging
Hi all,
I'm using Sikuli 1.0.1 on Windows7/Java7 and Pycharm as IDE for debugging with :
- jython2.5.3 as Pycharm Jython interpreter
- sikuli-java.jar in a local (pycharm) CLASSPATH env variable
- sikuli-java.jar set into the sys.path
- unittest2 installed (as explained here : https:/
My project is made up of a main.sikuli\main.py that import unittest2 suites to be run (actually .sikuli script...).
So in my main.py I just :
import unittest2
def suite():
modules_to_test = ('mySuite',)
alltests = unittest2.
for module in map(__import__, modules_to_test):
alltests.
return alltests
if __name__ == '__main__':
unittest2.
where mySuite.
from sikuli import *
import unittest2
class mySuite(
@classmethod
def setUpClass(cls):
cls.app = App(r"C:\Program Files (x86)\myapp")
cls.app.open()
cls.mainWindow = wait("window.png", 20)
cls.
def setUp(self):
def test_bool(self):
assert True == True
def tearDown(self):
@classmethod
def tearDownClass(cls):
cls.app.close()
Now, when I run the main.py everything works fine (myapp is open and the mainWindow found successfully).
But when I'm in debugging I get the following error :
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains
debugger.
File "C:\Program Files (x86)\JetBrains
pydev_
File "C:/POC/
unittest2.
File "C:\jython2.
self.module = __import__(module)
ImportError: No module named __main__
I do not understand what this __main__ module is ?
Please note that, in order to make debugging work in Pycharm, I was obliged to comment out the line 10 of the Sikuli.py (#import __main__) as explained in the https:/
Is this issue a side effect of this comment ?
Please, have you any idea ?
Thanks a lot,
Rod
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask rod for more information if necessary.