[Checkins] SVN: transaction/trunk/ Add explicit support for PyPy.
Tres Seaver
cvs-admin at zope.org
Wed May 16 21:13:46 UTC 2012
Log message for revision 125952:
Add explicit support for PyPy.
Changed:
U transaction/trunk/CHANGES.txt
U transaction/trunk/setup.py
U transaction/trunk/transaction/tests/convenience.txt
U transaction/trunk/transaction/tests/savepoint.txt
U transaction/trunk/transaction/tests/test_transaction.py
U transaction/trunk/transaction/tests/test_weakset.py
-=-
Modified: transaction/trunk/CHANGES.txt
===================================================================
--- transaction/trunk/CHANGES.txt 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/CHANGES.txt 2012-05-16 21:13:42 UTC (rev 125952)
@@ -4,6 +4,8 @@
1.2.1 (unreleased)
------------------
+- Added explicit support for PyPy.
+
- Dropped use of Python3-impatible ``zope.interface.implements`` class
advisor in favor of ``zope.interface.implementer`` class decorator.
Modified: transaction/trunk/setup.py
===================================================================
--- transaction/trunk/setup.py 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/setup.py 2012-05-16 21:13:42 UTC (rev 125952)
@@ -41,6 +41,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: Implementation :: CPython",
+ "Programming Language :: Python :: Implementation :: PyPy",
],
author="Zope Corporation",
author_email="zodb-dev at zope.org",
Modified: transaction/trunk/transaction/tests/convenience.txt
===================================================================
--- transaction/trunk/transaction/tests/convenience.txt 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/transaction/tests/convenience.txt 2012-05-16 21:13:42 UTC (rev 125952)
@@ -27,12 +27,12 @@
>>> dm.last_note
'test 3'
- >>> with transaction.manager:
+ >>> with transaction.manager: #doctest ELLIPSIS
... dm['z'] = 4
... xxx
Traceback (most recent call last):
...
- NameError: name 'xxx' is not defined
+ NameError: ... name 'xxx' is not defined
>>> dm['z']
3
Modified: transaction/trunk/transaction/tests/savepoint.txt
===================================================================
--- transaction/trunk/transaction/tests/savepoint.txt 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/transaction/tests/savepoint.txt 2012-05-16 21:13:42 UTC (rev 125952)
@@ -82,7 +82,7 @@
... print("%s %s" % ('Updated', name))
... except Exception as error:
... savepoint.rollback()
- ... print("%s %s" % ('Unexpected exception', error))
+ ... print("%s" % ('Unexpected exception'))
Now let's try applying some entries:
@@ -117,7 +117,7 @@
... ])
Updated bob
Updated sally
- Unexpected exception unsupported operand type(s) for +=: 'float' and 'str'
+ Unexpected exception
Because the apply_entries used a savepoint for the entire function, it was
able to rollback the partial changes without rolling back changes made in the
Modified: transaction/trunk/transaction/tests/test_transaction.py
===================================================================
--- transaction/trunk/transaction/tests/test_transaction.py 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/transaction/tests/test_transaction.py 2012-05-16 21:13:42 UTC (rev 125952)
@@ -36,7 +36,7 @@
add in tests for objects which are modified multiple times,
for example an object that gets modified in multiple sub txns.
"""
-from doctest import DocTestSuite, DocFileSuite
+from doctest import DocTestSuite, DocFileSuite, IGNORE_EXCEPTION_DETAIL
import struct
import sys
@@ -769,7 +769,8 @@
unittest.makeSuite(Test_oid_repr),
))
if sys.version_info >= (2, 6):
- suite.addTest(DocFileSuite('convenience.txt'))
+ suite.addTest(DocFileSuite('convenience.txt',
+ optionflags=IGNORE_EXCEPTION_DETAIL))
return suite
Modified: transaction/trunk/transaction/tests/test_weakset.py
===================================================================
--- transaction/trunk/transaction/tests/test_weakset.py 2012-05-16 21:13:39 UTC (rev 125951)
+++ transaction/trunk/transaction/tests/test_weakset.py 2012-05-16 21:13:42 UTC (rev 125952)
@@ -28,6 +28,7 @@
self.assertEqual(dummy2 in w, False)
def test_len(self):
+ import gc
w = WeakSet()
d1 = Dummy()
d2 = Dummy()
@@ -35,6 +36,7 @@
w.add(d2)
self.assertEqual(len(w), 2)
del d1
+ gc.collect()
self.assertEqual(len(w), 1)
def test_remove(self):
@@ -46,6 +48,7 @@
self.assertEqual(dummy in w, False)
def test_as_weakref_list(self):
+ import gc
w = WeakSet()
dummy = Dummy()
dummy2 = Dummy()
@@ -54,6 +57,7 @@
w.add(dummy2)
w.add(dummy3)
del dummy3
+ gc.collect()
L = [x() for x in w.as_weakref_list()]
# L is a list, but it does not have a guaranteed order.
self.assertTrue(list, type(L))
More information about the checkins
mailing list