X-1.0rc2: IDE: unittest.main() not usable - sys.argv is empty --- workaround --- fixed in 1.1.0
Bug #824185 reported by
Jonathan Sternberg
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Released
|
Critical
|
RaiMan |
Bug Description
*** workaround:
see comment #1
-------
If using the unittest module in the Sikuli IDE, it will fail after calling unittest.main() with this backtrace.
[error] Error message: Traceback (most recent call last):
File "C:\DOCUME~
unittest.main()
File "C:\Program Files\Sikuli X\sikuli-
IndexError: index out of range: 0
That line is:
It just looks like Sikuli isn't passing the program name as the first argument and the unittest module wants that.
Changed in sikuli: | |
status: | New → In Progress |
assignee: | nobody → RaiMan (raimund-hocke) |
tags: | added: scriptrun |
Changed in sikuli: | |
importance: | Undecided → Low |
tags: | added: jython |
Changed in sikuli: | |
importance: | Low → High |
milestone: | none → x1.0 |
Changed in sikuli: | |
importance: | High → Low |
milestone: | x1.0 → x1.1 |
summary: |
X-1.0rc2: IDE: unittest.main() not usable - sys.argv is empty --- - workaround + workaround --- fixed in 1.1.0 |
Changed in sikuli: | |
status: | In Progress → Fix Committed |
importance: | Low → Critical |
Changed in sikuli: | |
status: | Fix Committed → Fix Released |
milestone: | 1.1.0 → none |
To post a comment you must log in.
When running a script in the IDE that uses the unit test module, you cannot use unittest.main(), you have to use
suite = unittest. TestLoader( ).loadTestsFrom TestCase( TestClass) TextTestRunner( ).run(suite)
unittest.
to run your tests.
Only when running a script from command line, sys.argv is populated as expected.
So to be consistent, do not use unit test.main() generally.