Re: [Pydev-users] importing test code, that is below normal code
Brought to you by:
fabioz
From: peter <com...@ya...> - 2015-12-08 12:14:31
|
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. On 12/08/2015 12:47 PM, Fabio Zadrozny wrote: > I'm not sure I understood what you meant, so, let me try to guess here... > > In PyDev you just need to set the source folders (which are the > folders in your PYTHONPATH) -- see: > http://www.pydev.org/manual_101_project_conf2.html for details > > Then you can run the file with F9, or if it's a test case with Ctrl+F9 > -- see: http://www.pydev.org/manual_101_run.html for details. > > Hope that's what needed to get you going... > > Best Regards, > > Fabio > > On Tue, Dec 8, 2015 at 9:41 AM, peter <com...@ya... > <mailto:com...@ya...>> wrote: > > hi, > > > > from the commandline in can run: > python -m code/tests/distance_test > > > in the test class i got: > from code.find-1-motif-brute-force import y,x,z > > tests are under tests, and code is in code. > > > how can i do this with eclipse/pydev? > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for > multiple OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > _______________________________________________ > |