Home

pytest-pydev

This is a py.test plugin to connect to a remote debug server with PyDev or PyCharm.

With this plugin you can start a Python debug server on your local machine (say on port 8042) and your unittests on another.

Howto

We will assume that your local machine (where your IDE is running) has IP address 10.0.0.1.

Got to Run > Edit Configurations..., click on the big green plus (+) button and select Python Remote Debug. In the subsequent dialogue, you would fill in the following values:

Python remote debug configuration

It's also useful to setup path mappings to tell PyCharm were a file from the remote system can be found locally. This is very useful if you want to set a breakpoint.

path mappings

Got to your remote server and run your tests.

$ py.test --pydevd=10.0.0.1:8042

If it says

Starting debug server at port 8042
Waiting for connection...
Connected to pydev debugger (build 111.107)

in your IDE debug console, you're done.

If it complains about a wrong debugger version, you copy the file pycharm-debugger.egg from PyCharm's root directory to your server, e.g in folder /home/jasper. Then use

$ py.test --pydevd=10.0.0.1:8042 --pydev-lib=/home/jasper/pycharm-debug.egg

Download and Installation

You can install the plugin by running

$ pip install pytest-pydev

License and Credits

This plugin is released under the MIT license. You can find the full text of the license in the LICENSE file.

Copyright (C) 2012 Sebastian Rahlf <basti at redtoad dot de>

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.