SublimePythonCoverage is a plugin for Sublime Text 2 that can highlight lines of Python lacking test coverage, based on the output of Ned Batchelder's coverage.py.
Set up Sublime Package Control if you don't have it yet.
Go to Tools > Command Palette. Type Package Control: Install Package and hit enter. Type Python Coverage and hit enter. It may take a bit to install as it needs to fetch its dependency, coverage.py.
When you open a .py file, SublimePythonCoverage tries to find coverage information and mark all uncovered lines with a symbol in the gutter.
It does this by looking in all parent directories until it finds a .coverage file as produced by coverage.py. Obviously, it only works if that file exists and contains coverage information for the .py file you opened.
You can force a reload of the coverage information and redraw of the outlines by running the show_python_coverage command, bound to super+shift+c by default.
Set your build system to either Python Nose with Coverage or Python pytest with Coverage.
Now when you trigger a build in Sublime Text 2, it will run nosetests --with-coverage or py.test to generate coverage data, and then update the highlighted lines. In the latter case, your setup.cfg or pytest.ini is expected to provide the options necessary to test your package and generate coverage information.
SublimePythonCoverage uses a simple heuristic to guess the right nosetests/py.test script to run. First it looks in all parent directories for bin/nosetests/bin/py.test. If that fails, it tries to find nosetests/py.test in the PATH.
SublimePythonCoverage uses another heuristic to guess what path to pass to nosetests. If the directory of the current file is not a package, (i.e., does not contain an __init__.py), it runs nosetests on the current file. This does not work for py.test.
Otherwise, it looks in all parent directories for setup.py, and if it finds it it starts the test runner on that directory. If not, it runs the tests on the directory of the current file.