When I run a module I have open in an editor (Ctrl+F11), it brings up the 'Run As' dialog. This is expected on first run, so I select 'Python Run' for instance. But when I go to run the same module again immediately after, it brings up the 'Run As' dialog again. Shouldn't PyDev act like the Eclipse Java editor and remember the last run configuration? I'm not sure if this is a bug or if this is expected behaviour.
A workaround to this is to enable "Always launch the previously launched application" under Preferences > Run/Debug > Launching but is quite annoying; when switching between modules in the editor, PyDev will not launch the active editor. Any ideas? I'm using Eclipse 3.3.2 and PyDev 1.3.14.
Pydev can launch the current editor with F9 (python) or Ctrl+F9 (jython)... So, leave the "Always launch the previously launched application" enabled and use those shortcuts to launch the current editor.
F9 works, but is there also a key available to run as python unit-test?
Not really... usually what I do is that the test module has as its main:
if __name__ == '__main__':
....#import sys;sys.argv = ['', 'Test.testXXX']
That way I can run it as a regular run and it'll run the tests, and it also helps in choosing a single test to run when uncommenting the line that changes argv... (I put that in my default template for tests).
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.