From 72b515bb673cfbaf287276ad7c9475d4588cd0c0 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Fri, 29 Jun 2012 11:21:50 -0700 Subject: Add support for PyPy (issue #125). --- pystache/tests/test_locator.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pystache') 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) -- cgit v1.2.1