[Checkins] SVN: zope.event/trunk/ Document running tests / building docs w/ tox.
Tres Seaver
cvs-admin at zope.org
Fri Jun 29 14:45:03 UTC 2012
Log message for revision 127190:
Document running tests / building docs w/ tox.
Changed:
_U zope.event/trunk/
U zope.event/trunk/docs/hacking.rst
-=-
Modified: zope.event/trunk/docs/hacking.rst
===================================================================
--- zope.event/trunk/docs/hacking.rst 2012-06-29 14:27:46 UTC (rev 127189)
+++ zope.event/trunk/docs/hacking.rst 2012-06-29 14:44:59 UTC (rev 127190)
@@ -218,6 +218,88 @@
Build finished. The HTML pages are in .../docs/_build/html.
+Running Tests on Multiple Python Versions via :mod:`tox`
+--------------------------------------------------------
+
+`tox <http://tox.testrun.org/latest/>`_ is a Python-based test automation
+tool designed to run tests against multiple Python versions. It creates
+a ``virtualenv`` for each configured version, installs the current package
+and configured dependencies into each ``virtualenv``, and then runs the
+configured commands.
+
+:mod:`zope.event` configures the following :mod:`tox` environments via
+its ``tox.ini`` file:
+
+- The ``py26`` environment builds a ``virtualenv`` with ``python2.6``,
+ installs :mod:`zope.event`, and runs the tests
+ via ``python setup.py test -q``.
+
+- The ``py27`` environment builds a ``virtualenv`` with ``python2.7``,
+ installs :mod:`zope.event`, and runs the tests
+ via ``python setup.py test -q``.
+
+- The ``py32`` environment builds a ``virtualenv`` with ``python3.2``,
+ installs :mod:`zope.event` and dependencies, and runs the tests
+ via ``python setup.py test -q``.
+
+- The ``pypy`` environment builds a ``virtualenv`` with ``pypy``,
+ installs :mod:`zope.event`, and runs the tests
+ via ``python setup.py test -q``.
+
+- The ``coverage`` environment builds a ``virtualenv`` with ``python2.6``,
+ installs :mod:`zope.event`, installs
+ :mod:`nose` and :mod:`coverage`, and runs ``nosetests`` with statement
+ coverage.
+
+- The ``docs`` environment builds a virtualenv with ``python2.6``, installs
+ :mod:`zope.event`, installs ``Sphinx`` and
+ dependencies, and then builds the docs and exercises the doctest snippets.
+
+This example requires that you have a working ``python2.6`` on your path,
+as well as installing ``tox``:
+
+.. code-block:: sh
+
+ $ tox -e py26
+ GLOB sdist-make: .../zope.interface/setup.py
+ py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip
+ py26 runtests: commands[0]
+ ...
+ ----------------------------------------------------------------------
+ Ran 2 tests in 0.000s
+
+ OK
+ ___________________________________ summary ____________________________________
+ py26: commands succeeded
+ congratulations :)
+
+Running ``tox`` with no arguments runs all the configured environments,
+including building the docs and testing their snippets:
+
+.. code-block:: sh
+
+ $ tox
+ GLOB sdist-make: .../zope.interface/setup.py
+ py26 sdist-reinst: .../zope.interface/.tox/dist/zope.interface-4.0.2dev.zip
+ py26 runtests: commands[0]
+ ...
+ Doctest summary
+ ===============
+ 17 tests
+ 0 failures in tests
+ 0 failures in setup code
+ 0 failures in cleanup code
+ build succeeded.
+ ___________________________________ summary ____________________________________
+ py26: commands succeeded
+ py27: commands succeeded
+ py32: commands succeeded
+ pypy: commands succeeded
+ coverage: commands succeeded
+ docs: commands succeeded
+ congratulations :)
+
+
Submitting a Bug Report
-----------------------
More information about the checkins
mailing list