views:

174

answers:

3

I know Ctrl + F9 runs a single file.

How to run them all?

If there is no such thing, how to bind one keyboard shortcut to it?

+2  A: 

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)

VonC
A: 

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.

Jason Tholstrup
Python unit tests don't appear in the key configuration menu
Jader Dias
+1  A: 

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 )

Mark