Orange Forum • View topic - A lot of failed unit tests; import errors

A lot of failed unit tests; import errors

A place to ask questions about methods in Orange and how they are used and other general support.

A lot of failed unit tests; import errors

Postby whoeverest » Mon Mar 19, 2012 13:55

Hello! :-)

Since this is my first post, I guess I should introduce myself. My name is Andrej, I'm a computer engineering student. I'm at the end of my studies, getting ready to write my bachelor thesis. It's a machine learning project: an algorithm based that will detect an intruder on someones' computer based on patterns in the timing of keystrokes.

While looking for a Python framework that suits my needs, I came across Orange. I downloaded the source, set up the development environment just like in the tutorial and got Orange to run. And something is amiss.

Orange with canvas is running perfectly. Importing "orange" in Python yields no errors; the examples from the tutorials are working great. But when I try to run the other (no-canvas and c++) debug configurations, I get a lot of errors. Here's a sceenshot:

Image

Some of the errors are import errors similar to:

Code: Select all
ImportError: No module named source.orangeqt.modules.FindPyQt
ERROR: Module: source.orangeqt.modules.FindPyQt could not be imported (file: /home/who/code/source/orangeqt/modules/FindPyQt.py).
Traceback (most recent call last):
  File "/home/who/.eclipse/org.eclipse.platform_3.5.0_155965261/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydev_runfiles.py", line 307, in __get_module_from_str
    mod = __import__(modname)

or:

Code: Select all
ImportError: No module named testing.regression.tests_20.reference_treelearner
ERROR: Module: Orange.testing.regression.tests_20.reference_treelearner could not be imported (file: /home/who/code/Orange/testing/regression/tests_20/reference_treelearner.py).
Traceback (most recent call last):
  File "/home/who/.eclipse/org.eclipse.platform_3.5.0_155965261/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydev_runfiles.py", line 307, in __get_module_from_str
    mod = __import__(modname)


Please bare in mind that I'm not very experienced with building projects in Eclipse. I may be running something I shouldn't. I tried working around this myself before asking something that would end up being trivial, but had no luck.

I need your help guys. Thanks! :-)

Re: A lot of failed unit tests; import errors

Postby Ales » Tue Mar 20, 2012 12:35

I think this is just an over-zealot eclipse unittest test discovery. For instance "source.orangeqt.modules.FindPyQt" is most definitely not a unittest.

Re: A lot of failed unit tests; import errors

Postby whoeverest » Wed Mar 21, 2012 15:36

Ales wrote:I think this is just an over-zealot eclipse unittest test discovery. For instance "source.orangeqt.modules.FindPyQt" is most definitely not a unittest.


You're right. I tried running the unit tests with "python test-examples.py" but the script failed. There was a problem with the test_suite_scripts import statement at line 30. I changed:

Code: Select all
from Orange.testing import test_suite_scripts

to:

Code: Select all
from Orange.misc.testing import test_suite_scripts

and it worked. The 80 unit test ran and there were 12 errors, most of which caused by a missing "MySQLdb" module.

Thanks! :)


Return to Questions & Support