Skip to main content

ulif.plone.testsetup

is a package that provides some convenience stuff to enable rapid test setup for Plone packages. Currently doctests (normal unit doctests and functional doctests) and usual Python tests made of unittest.TestCase (and derived) definitions are supported.

Doctests and test modules are found throughout a whole package and registered with sensible, modifiable defaults.

Also support for reusable test setups is provided by so-called TestGetters and TestCollectors.

Setting up doctests (contrary to writing those tests) can become cumbersome with Plone. In the environment you often have to prepare complex things like test layers, setup functions, teardown functions and much more. Often this steps have to be done again and again.

ulif.plone.testsetup can shorten this work by setting sensible defaults for the most important aspects of test setups.

See README.txt in the src/ulif/plone/testsetup directory for API documentation. ulif.plone.testsetup is an extension of the Zope 3 package z3c.testsetup in which all the basic stuff is defined and documented. Please see the .txt files in this package for deeper insights about TestCollectors and the like.

Note, that this is alphaware! Do not use it in productive environments!

Prerequisites

You need:

- Python 2.4. Rumors are, that also Python 2.5 will do.

Other needed packages will be downloaded during installation. Therefore you need an internet connection during installation.

Installation

From the root of the package run:

$ python2.4 bootstrap/bootstrap.py

This will download and install everything to run buildout in the next step. Afterwards an executable script buildout should be available in the freshly created bin/ directory.

Next, fetch all needed packages, install them and create provided scripts:

$ bin/buildout

This should create an instance script in bin/.

Running:

$ bin/instance test -s ulif.plone.testsetup

you can test the installed package.

Usage

See README.txt and the other .txt files in the src/ulif/plone/testsetup directory for API documentation.

Detailed Documentation

ulif.plone.testsetup

A package for easier test setups with Plone 3.

ulif.plone.testsetup tries to ease the writing of testsetups. This can be a mess, especially when using Plone. There is always a complex framework to setup and all that might afraid people so that they do not write tests at all. In that sense, ulif.plone.testsetup is a try to take away excuses for not testing.

Note, that this package is meant for use with Plone 3. Other versions are not tested!

Please note also, that this document is not an introduction into writing tests, but into setup of tests. The difference is, that the many kind of tests supported by Zope and Python need to be found by a testrunner and some, functional tests for example, need a special framework to be setup before the tests can actually run. That’s what this package is for: minimizing the effort, to find and setup tests.

A Simple Test Setup

Setting up a test with this package in the minimal form comes down to this:

>>> from ulif.plone.testsetup import register_all_plone_tests
>>> test_suite = register_all_plone_tests(
...    'ulif.plone.testsetup.tests.cave')

This will find all tests registered in the cave package and deliver them to a testrunner when called. All we have to do, is to get the register_all_plone_tests function and to pass it a package.

We specified the package to be searched for tests by a so-called dotted name, but we can also pass the real package:

>>> from ulif.plone.testsetup.tests import cave
>>> test_suite = register_all_plone_tests(cave)

In both cases we will get a PloneTestCollector:

>>> test_suite
<ulif.plone.testsetup.plonetesting.PloneTestCollector object at 0x...>

When called, it will return a test suite:

>>> test_suite()
<unittest.TestSuite tests=[...]>

CHANGES

0.1.2 (2008-07-11)

Bug fixes

  • Pin down zope.testing version due to incompatibilities with plone.recipe.zop2install.

0.1.1 (2008-07-11)

Bug fixes

  • Fixed imports according to new z3c.testsetup release.

0.1 (2008-03-05)

Feature changes

  • Initial release, factored out from z3c.testsetup-dev

Download

Release files for ulif.plone.testsetup 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for ulif.plone.testsetup 0.1.2
File Size Uploaded
ulif.plone.testsetup-0.1.2.zip 19.5 kB Details
ulif.plone.testsetup-0.1.2.tar.gz 9.0 kB Details

Release files / ulif.plone.testsetup-0.1.2.zip

Download URL ulif.plone.testsetup-0.1.2.zip
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
626f0127d762c5bce37c66dd4d6662ddacab409ddd6a0c03cb44b329f0391861
BLAKE2b-256 checksum
How to use checksums
7ea1940b8437b3cdf32476bd2bd405a80dbe9078e763b6def0e342ad4b56b03a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ulif.plone.testsetup-0.1.2.tar.gz

Download URL ulif.plone.testsetup-0.1.2.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
54b24fde670b650e4f8cff5e6dd4dcc07299547f4240d1840722d784f2f5d76e
BLAKE2b-256 checksum
How to use checksums
558a3f46dc463743319382d355a61ca2d580e189d38a9443bc1194ef544ec868
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page