.. include:: header.txt

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/test_connection.py>`_
         Test of the connection types used by the package.

     `test_doc.py <../test/test_doc.py>`_
         A test of the default manager and proxy objects using `doctest`.

     `test_newtype.py <../test/test_newtype.py>`_
         Demonstration of how to create and use customized managers
         and proxies.

     `test_pool <../test/test_pool.py>`_
         Test of the `Pool` class which represents a process pool.

     `test_processing.py <../test/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/test_reduction.py>`_
         Test that socket objects and connection objects can 
         be transfered between processes.
      
     `test_stop.py <../test/test_stop.py>`_
         A test of `Process.stop()` and `Process.terminate()`.

     `test_workers.py <../test/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 <../test/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 <../test/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.


.. _Prev: programming-guidelines.html
.. _Up: index.html
.. _Next: tests.html
