Prev         Up         Next

Tests

The processing package contains a test sub-package which contains various test modules.

You can do a test run by doing:

python -m processing.test

on Python 2.5 or

python -c "from processing.test import main; main()"

on Python 2.4.

This will run the tests in the following modules:

test_connection.py
Test of the connection types used by the package.
test_doc.py
A test of the default manager and proxy objects using doctest.
test_newtype.py
Demonstration of how to create and use customized managers and proxies.
test_pool
Test of the Pool class which represents a process pool.
test_processing.py
Test of synchronization types like locks, conditions and queues. Takes quite a while to run because it uses time.sleep() a lot.
test_reduction.py
Test that socket objects and connection objects can be transfered between processes.
test_stop.py
A test of Process.stop() and Process.terminate().
test_workers.py
A test showing how to use queues to feed tasks to a collection of worker process and collect the results.

In a full test run most of these tests will be run using both processes and threads (by using the processing.dummy sub-package).

Also included in test/ are

test_httpserverpool.py
An example of how a pool of worker processes can each run a SimpleHTTPServer.HttpServer instance while sharing a single listening socket.
test_speed.py
Some simple benchmarks comparing processing with threading.

All the modules in the test folder use freezeSupport() so frozen executables can be produced from them by using py2exe, PyInstaller or cx_Freeze in the usual way.