• HOWTO Run the Opencore Unit Tests

last modified March 23, 2009 by ejucovy

Running the Unit Tests

To run the unit tests for opencore, use this command:

(mydeployenv)~/mydeployenv$ zopectl test -s opencore

The -s argument is a pattern specifiying which package(s) to test. You must specify opencore, or you'll get tons of spurious errors from stuff that isn't ours (don't ask...). You can be more specific if you want to test just the part you're working on:

(mydeployenv)~/mydeployenv$ zopectl test -s opencore.project.browser
... but please always run the full set before checking in.

The tests take several minutes on fast hardware. We all hate that. Sorry.  Run them frequently anyway and we will buy you a puppy.

Most of these tests are not *actually* unit tests; they require functional test layers to be set up, which is why they take so long.  To run the (very few) actual unit tests, which take a fraction of the time to execute, run this command:

(mydeployenv)~/mydeployenv$ zopectl test -s opencore -u


One more tip - don't worry when the tests end with an exception like "Exception exceptions.AttributeError: "'NoneType' object has no attribute 'has_key'". This is a harmless cleanup bug in the version of Plone we're using (it's fixed in later versions).

See also HOWTO Run the Flunc tests