Attention

This document was written for an old version of Plone, Plone 3, and was last updated 1204 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Running unit tests

by Mikko Ohtamaa last modified Feb 04, 2009 03:08 AM
You can run unit tests for your product directly from Eclipse.

Unit tests are an automatic test suite to check that your product is intact after changes and there has not been regression. Plone has wonderful support for unit testing.

Setting up the unit test launcher
---------------------------------

Create a PyDev Python run launcher as normally from *Run -> Open Run Dialog* menu. Use *Python run*, not *Python unit test* as the launcher type, since PyDev unit test result parser might not be compatible with Zope specific unit test output.

For the program, choose (on Linux)

::

${workspace_loc:project/bin/instance};

Program arguments for testing the whole package are:

::

test -s some.package

Program arguments for testing a single test case class are:

::

test -s some.package testCaseName.py

If no tests are run (test count = 0) then you have probably an error with your package name.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.