Commit 58640f04 by Chris Jerdonek

Added documentation re: tox.

parent 6d2f1b48
...@@ -6,6 +6,7 @@ History ...@@ -6,6 +6,7 @@ History
* Added support for Python 3.2 (following conversion with 2to3_). * Added support for Python 3.2 (following conversion with 2to3_).
* Test runner now supports both yaml and json forms of Mustache spec. * Test runner now supports both yaml and json forms of Mustache spec.
* Added tox support to test multiple Python versions.
0.5.0 (2012-04-03) 0.5.0 (2012-04-03)
------------------ ------------------
......
...@@ -134,50 +134,42 @@ default to values set in Pystache's ``defaults`` module. ...@@ -134,50 +134,42 @@ default to values set in Pystache's ``defaults`` module.
Test It Test It
======= =======
Pystache can be tested using both Python 2 and 3 -- even from a single Use tox_ to test Pystache with multiple versions of Python all at once! ::
Python 2 install if using Distribute's ``test`` (see below).
pip install tox
tox -e py26,py27 # for example
# Or, if you have all versions of Pythons in tox.ini, simply
tox
To include tests from the Mustache spec in your test runs: :: To include tests from the Mustache spec in your test runs: ::
git submodule init git submodule init
git submodule update git submodule update
You can also test Pystache without tox (but with only a single version of
Python at a time), as below. First, install Distribute_ ::
Python 3 pip install distribute
--------
For Python 3, we recommend installing and using Distribute_.
Then one can invoke `Distribute's test`_ command: ::
python setup.py test
Python 2 Python 2.7 and Later
-------- --------------------
For Python 2, we recommend nose_: :: Then run `Distribute's test`_: ::
pip install nose python setup.py test
cd pystache
nosetests
Depending on your Python version and nose installation, you may need
to type, for example-- ::
nosetests-2.4 When using Python 3, this runs 2to3_ on the source code automatically.
To run all available tests (including doctests)-- ::
nosetests --with-doctest --doctest-extension=rst Python 2.6 and Earlier
----------------------
or alternatively (using setup.cfg)-- :: For Python 2.6 and earlier, use nose_ instead of ``test``: ::
pip install nose
python setup.py nosetests python setup.py nosetests
To run a subset of the tests, you can use this pattern, for example-- ::
nosetests --tests tests/test_context.py:GetValueTests.test_dictionary__key_present
Mailing List Mailing List
============ ============
...@@ -200,6 +192,7 @@ Author ...@@ -200,6 +192,7 @@ Author
Chris Wanstrath :: chris@ozmm.org Chris Wanstrath :: chris@ozmm.org
.. _2to3: http://docs.python.org/library/2to3.html
.. _ctemplate: http://code.google.com/p/google-ctemplate/ .. _ctemplate: http://code.google.com/p/google-ctemplate/
.. _David Phillips: http://davidphillips.us/ .. _David Phillips: http://davidphillips.us/
.. _Distribute: http://pypi.python.org/pypi/distribute .. _Distribute: http://pypi.python.org/pypi/distribute
...@@ -216,4 +209,5 @@ Author ...@@ -216,4 +209,5 @@ Author
.. _semantically versioned: http://semver.org .. _semantically versioned: http://semver.org
.. _simplejson: http://pypi.python.org/pypi/simplejson/ .. _simplejson: http://pypi.python.org/pypi/simplejson/
.. _built-in unicode function: http://docs.python.org/library/functions.html#unicode .. _built-in unicode function: http://docs.python.org/library/functions.html#unicode
.. _tox: http://pypi.python.org/pypi/tox
.. _version 1.0.3: https://github.com/mustache/spec/tree/48c933b0bb780875acbfd15816297e263c53d6f7 .. _version 1.0.3: https://github.com/mustache/spec/tree/48c933b0bb780875acbfd15816297e263c53d6f7
...@@ -43,6 +43,7 @@ py_version = sys.version_info ...@@ -43,6 +43,7 @@ py_version = sys.version_info
# Distribute works with Python 2.3.5 and above: # Distribute works with Python 2.3.5 and above:
# http://packages.python.org/distribute/setuptools.html#building-and-distributing-packages-with-distribute # http://packages.python.org/distribute/setuptools.html#building-and-distributing-packages-with-distribute
if py_version < (2, 3, 5): if py_version < (2, 3, 5):
# TODO: this might not work yet.
import distutils as dist import distutils as dist
from distutils import core from distutils import core
setup = core.setup setup = core.setup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment