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.
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not really... usually what I do is that the test module has as its main:
#===================================================================================================
# main
#===================================================================================================
if __name__ == '__main__':
....#import sys;sys.argv = ['', 'Test.testXXX']
....unittest.main()
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).
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
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.
Peter
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.
Cheers,
Fabio
F9 works, but is there also a key available to run as python unit-test?
Ciao,
Steffen
Not really... usually what I do is that the test module has as its main:
#===================================================================================================
# main
#===================================================================================================
if __name__ == '__main__':
....#import sys;sys.argv = ['', 'Test.testXXX']
....unittest.main()
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).
Cheers,
Fabio