summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-06-29 11:21:50 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-06-29 11:21:50 -0700
commit72b515bb673cfbaf287276ad7c9475d4588cd0c0 (patch)
tree55532b0eabd66f13efe777c78c1fcd1c8f5b1b8b
parente76ec45981646414e3f0a250953133d11dd90a25 (diff)
downloadpystache-72b515bb673cfbaf287276ad7c9475d4588cd0c0.tar.gz
Add support for PyPy (issue #125).
-rw-r--r--.travis.yml3
-rw-r--r--HISTORY.md1
-rw-r--r--README.md1
-rw-r--r--pystache/tests/test_locator.py12
-rw-r--r--tox.ini4
5 files changed, 16 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index bad487d..a426b13 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,8 +6,7 @@ python:
- 2.6
- 2.7
- 3.2
- # TODO: get all tests passing with PyPy.
- #- pypy
+ - pypy
script:
- python setup.py install
diff --git a/HISTORY.md b/HISTORY.md
index 99286ad..91aca27 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -10,6 +10,7 @@ History
parse tree.
- Added support for rendering pre-compiled templates.
- Added --force2to3 option to setup.py (issue \#121).
+- Added support for [PyPy](http://pypy.org/).
- Added support for [Travis CI](http://travis-ci.org) (issue \#124). [msabramo]
- Bugfix: exceptions raised from a property are no longer swallowed
when getting a key from a context stack (issue \#110).
diff --git a/README.md b/README.md
index 88daf92..f6340e1 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,7 @@ Pystache is tested with--
- Python 2.7
- Python 3.1
- Python 3.2
+- [PyPy](http://pypy.org/)
[Distribute](http://packages.python.org/distribute/) (the setuptools fork)
is recommended over [setuptools](http://pypi.python.org/pypi/setuptools),
diff --git a/pystache/tests/test_locator.py b/pystache/tests/test_locator.py
index f17a289..8d4ec9b 100644
--- a/pystache/tests/test_locator.py
+++ b/pystache/tests/test_locator.py
@@ -53,7 +53,17 @@ class LocatorTests(unittest.TestCase, AssertExceptionMixin):
def test_get_object_directory__not_hasattr_module(self):
locator = Locator()
- obj = datetime(2000, 1, 1)
+ # Previously, we used a genuine object -- a datetime instance --
+ # because datetime instances did not have the __module__ attribute
+ # in CPython. See, for example--
+ #
+ # http://bugs.python.org/issue15223
+ #
+ # However, since datetime instances do have the __module__ attribute
+ # in PyPy, we needed to switch to something else once we added
+ # support for PyPi. This was so that our test runs would pass
+ # in all systems.
+ obj = "abc"
self.assertFalse(hasattr(obj, '__module__'))
self.assertEqual(locator.get_object_directory(obj), None)
diff --git a/tox.ini b/tox.ini
index d1aef0d..b5a9394 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@
# http://pypi.python.org/pypi/tox
#
[tox]
-envlist = py24,py25,py26,py27,py27-yaml,py27-noargs,py31,py32
+envlist = py24,py25,py26,py27,py27-yaml,py27-noargs,py31,py32,pypy
[testenv]
# Change the working directory so that we don't import the pystache located
@@ -11,7 +11,7 @@ envlist = py24,py25,py26,py27,py27-yaml,py27-noargs,py31,py32
changedir =
{envbindir}
commands =
- pystache-test {toxinidir}/ext/spec/specs {toxinidir}
+ pystache-test {toxinidir}/ext/spec/specs {toxinidir}
# Check that the spec tests work with PyYAML.
[testenv:py27-yaml]