Re: [Pydev-users] importing test code, that is below normal code
Brought to you by:
fabioz
From: peter <com...@ya...> - 2015-12-08 13:02:06
|
On 12/08/2015 01:29 PM, Fabio Zadrozny wrote: > > > On Tue, Dec 8, 2015 at 10:16 AM, peter <com...@ya... > <mailto:com...@ya...>> wrote: > > i should have posted the error message, lets try it again: > > project looks like this: > http://erntehelfer.ddns.net/tmp/test.png > > since i used the pydev wizard to create the project, the files > should be in the PYTHONPATH. > > now i run the file: > distance_test.py as python unit test > > > error i get: > Traceback (most recent call last): > File > "/home/julius/Downloads/eclipse-java-mars-1-linux-gtk-x86_64/plugins/org.python.pydev_4.4.0.201510052309/pysrc/pydev_runfiles.py", > line 468, in __get_module_from_str > mod = __import__(modname) > File > "/home/julius/workspace-mars/Bachelorarbeit/tests/distance_test.py", > line 2 > from code.find-1-motif-brute-force import is_trivial_match, > find_motif_brute_force > ^ > SyntaxError: invalid syntax > ERROR: Module: distance_test could not be imported (file: > /home/julius/workspace-mars/Bachelorarbeit/tests/distance_test.py). > > > > @nathan: i will change the hyphens, but this project works when > run from console. > > > Humm, really weird that it works in the console (it doesn't make much > sense... having hyphen characters in the import isn't allowed as far > as I know and should really give you a syntax error as that's not a > valid python name). > > The real fix should be really changing the hyphens for underscores. > > Best Regards, > > Fabio > found it, the part "code." was wrong, and i changed one file from only methods to a class. sry, forgot about that thx for the support |