[Zodb-checkins] SVN: ZODB/branches/tseaver-python_picklecache-2/src/persistent/tests/test_persistent.py Make test for 'simple_new' conditional.
Tres Seaver
tseaver at palladion.com
Wed Feb 16 00:04:31 EST 2011
Log message for revision 120364:
Make test for 'simple_new' conditional.
Changed:
U ZODB/branches/tseaver-python_picklecache-2/src/persistent/tests/test_persistent.py
-=-
Modified: ZODB/branches/tseaver-python_picklecache-2/src/persistent/tests/test_persistent.py
===================================================================
--- ZODB/branches/tseaver-python_picklecache-2/src/persistent/tests/test_persistent.py 2011-02-16 05:04:29 UTC (rev 120363)
+++ ZODB/branches/tseaver-python_picklecache-2/src/persistent/tests/test_persistent.py 2011-02-16 05:04:31 UTC (rev 120364)
@@ -11,7 +11,13 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-from persistent import Persistent, simple_new
+from persistent import Persistent
+
+try:
+ from persistent import simple_new
+except ImportError:
+ simple_new = None
+
import os
if os.environ.get('USE_ZOPE_TESTING_DOCTEST'):
from zope.testing import doctest
@@ -40,13 +46,14 @@
TypeError: this object has no instance dictionary
"""
-def cpersistent_simple_new_invalid_argument():
- """
- >>> simple_new('')
- Traceback (most recent call last):
- ...
- TypeError: simple_new argument must be a type object.
- """
+if simple_new is not None:
+ def cpersistent_simple_new_invalid_argument():
+ """
+ >>> simple_new('')
+ Traceback (most recent call last):
+ ...
+ TypeError: simple_new argument must be a type object.
+ """
def test_suite():
return unittest.TestSuite((
More information about the Zodb-checkins
mailing list