What is the keyboard shortcut to run all unit tests in the current project in PyDev + Eclipse?
I know Ctrl + F9 runs a sin开发者_StackOverflow社区gle file.
How to run them all?
If there is no such thing, how to bind one keyboard shortcut to it?
Why not:
- define a suite of tests, or a target in an ant script (like this one, at the bottom of the article), -and then associate a launch configuration (an external one for the ant script)?
You could then use a shortcut to that launch configuration (as in this thread).
One solution for that is to always launch the last application (F11 or Ctrl+F11 )
<target name="tests" depends="compile">
<py-test pythonpath="${src.dir}" dir=".">
<fileset dir="${src.dir}">
<include name="**/*Test.py"/>
</fileset>
</py-test>
</target>
Note: there are other ways to integrate unit testing with pydev, as shown in SO question Continuous unit testing with Pydev (Python and Eclipse)
Click on a folder that contains tests in the pydev package explorer. Then the run menu option (which is not f9 for me but cmd+shift+F11 (OK I am on OSX but I suspect this would be ctrl+shift+f11 elsewhere) This runs all the tests it can find in subdirectories
To repeat you need to do as per VonC's answer
You could then use a shortcut to that launch configuration (as in this thread).
One solution for that is to always launch the last application (F11 or Ctrl+F11 )
Go to the preferences and type in keys to get to the keyboard shortcut definition page (I think it's called keys... sorry not on my dev machine right now). In this dialog you can search for commands. See if there is a run all tests command (it might help to find the run tests you are currently using first). If there is check out the shortcut or define your own.
精彩评论