I have a test framework where all my tests have to be kicked off using a particular executable(say M). All my tests are written in python(I have eclipse configured with pydev) . Currently I run my tests are run thru cmdline like:
$ M -test <test_file_name>.<testcase_name>
How do I configure eclipse run configuration so I can actually do run /debug from eclipse? I am not able able to find any documentation that tells me if I can use the "Program Arguments" in the run/debug configuration to set this up?

- 136
- 13
2 Answers
PyDev always will run with the python executable you configure in the interpreter preferences (so, if you want to run with a different executable, it'll only work if it's a program that is configured in the interpreter preferences and that can launch any python script -- as does the regular interpreter).
If that's not your case, what you can do is configure an external tool to make the run (run > external tools > external tools configurations > program) and then use it to run.
Now, if your executable does work as a python executable (or if you're running with Python itself) see:
Getting started on how to run a program: http://pydev.org/manual_101_run.html
How to run a unittest: http://pydev.org/manual_adv_pyunit.html

- 24,814
- 4
- 66
- 78
-
Configuring the external tools did it. Thanks! Now I need to find to the equivalent of http://stackoverflow.com/questions/1042971/how-to-run-an-external-tool-in-eclipse-in-debug-mode for pydev – py_newbie Jun 08 '15 at 21:46
-
1This is the remote debugger in PyDev: http://pydev.org/manual_adv_remote_debugger.html – Fabio Zadrozny Jun 10 '15 at 00:03
-
Thanks Fabio! Yes, I went thru this and set it up, but I am still wondering how to set up python remote debugger with external tools(The first step I did )? I am looking for similar steps https://docs.joomla.org/Running_Automated_Tests_from_Eclipse to use my external tools with python remote debugger – py_newbie Jun 11 '15 at 23:35
-
1Well, it should be a matter of creating a script which sets the PYTHONPATH to pydevd and does pydevd.settrace(suspend=False) as the first thing (and then goes on to running your code) -- note that in preferences > pydev > run/debug, you can set the remote debugger activation to be 'always on' (which may be helpful in this case). – Fabio Zadrozny Jun 12 '15 at 16:01
-
Ok so turns out I didnt have to use remote debugger. If you click on Debug configurations to create a new one , in the "main module" section the browser button allows you to only select .py file, so simply ditch it and paste the path to your executable(inclusive) in there and you are set. – py_newbie Jun 25 '15 at 00:52
-
Thanks @Fabio Zadrozny for all your help! – py_newbie Jun 25 '15 at 00:53
You have to configure PyDev and give him a path to the executable/interpreter
From this site :
Go to: window > preferences > PyDev > Interpreter - (Python/Jython/IronPython).
Choose the interpreter you have installed in your computer (such as python.exe, jython.jar or ipy.exe).
-
I have already done that. My question is can I give the name of an executable (not a .py file) as a starting point for a run – py_newbie Jun 04 '15 at 01:54