Skip to content
unit test generator for Python
Python Other
Find file
Pull request Compare This branch is 7 commits ahead, 3 commits behind mkwiatkowski:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Easiest way to get Pythoscope is via setuptools::

  $ easy_install pythoscope

You can also download a source package from
or get a copy of a development branch using `bazaar <>`_::

  $ bzr branch lp:pythoscope

To install the package from the source directory do::

  $ python install

You don't need setuptools for this to work, a bare Python will do just fine.

However, if you *do* have setuptools installed, you may also consider running
the whole test suite of Pythoscope::

  $ python test


You can use the tool through a single **pythoscope** command. To prepare
your project for use with Pythoscope, type::

  $ pythoscope --init path/to/your/project/

It's only doing static analysis, and doesn't import your modules or
execute your code in any way, so you're perfectly safe to run it on
anything you want. After that, a directory named **.pythoscope** will be
created in the current directory. To generate test stubs based on your
project, select files you want to generate tests for::

  $ pythoscope  path/to/your/project/specific/  path/to/your/project/other/*.py

Test files will be saved to your test directory, if you have one, or
into a new **tests/** directory otherwise. Test cases are aggregated
into TestCase classes. Currently each production class and each
production function gets its own TestCase class.

Some of the classes and functions are ignored by the generator - all
which name begins with an underscore, exception classes, and some

Generator itself is configurable to some extent, see::

  $ pythoscope --help

for more information on available options.

Editor Integration


We put out an elisp script that integrates Pythoscope into Emacs. The file is in the the misc/ directory of the source distribution. You can also `look at the file on Launchpad <>`_. Usage and installation instructions are in the comments at the top of the file.


There is interest in Vim integration and someone is working on it but we have nothing for you right now.


There was much discussion of Leo on `the mail list editor integration thread <>`_.


All Pythoscope source code is licensed under an MIT license (see LICENSE file).
All files under lib2to3/ are licensed under PSF license.
File named under bytecode_tracer/ is also licensed under PSF license.
Something went wrong with that request. Please try again.