[Zodb-checkins] SVN: ZODB/trunk/src/ Use doctest rather than zope.testing.doctest.
Jim Fulton
jim at zope.com
Tue May 18 15:44:12 EDT 2010
Log message for revision 112484:
Use doctest rather than zope.testing.doctest.
Changed:
U ZODB/trunk/src/BTrees/tests/test_fsBTree.py
U ZODB/trunk/src/ZEO/scripts/tests.py
U ZODB/trunk/src/ZEO/tests/testConnection.py
U ZODB/trunk/src/ZEO/tests/testConversionSupport.py
U ZODB/trunk/src/ZEO/tests/testZEO2.py
U ZODB/trunk/src/ZEO/tests/test_cache.py
U ZODB/trunk/src/ZODB/FileStorage/tests.py
U ZODB/trunk/src/ZODB/scripts/tests/test_doc.py
U ZODB/trunk/src/ZODB/tests/PackableStorage.py
U ZODB/trunk/src/ZODB/tests/sampledm.py
U ZODB/trunk/src/ZODB/tests/testBroken.py
U ZODB/trunk/src/ZODB/tests/testCache.py
U ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
U ZODB/trunk/src/ZODB/tests/testDB.py
U ZODB/trunk/src/ZODB/tests/testDemoStorage.py
U ZODB/trunk/src/ZODB/tests/testFileStorage.py
U ZODB/trunk/src/ZODB/tests/testSerialize.py
U ZODB/trunk/src/ZODB/tests/testUtils.py
U ZODB/trunk/src/ZODB/tests/test_cache.py
U ZODB/trunk/src/ZODB/tests/test_datamanageradapter.py
U ZODB/trunk/src/ZODB/tests/test_doctest_files.py
U ZODB/trunk/src/ZODB/tests/test_fsdump.py
U ZODB/trunk/src/ZODB/tests/testcrossdatabasereferences.py
U ZODB/trunk/src/ZODB/tests/testfsoids.py
U ZODB/trunk/src/ZODB/tests/testmvcc.py
U ZODB/trunk/src/ZODB/tests/testpersistentclass.py
U ZODB/trunk/src/persistent/tests/test_PickleCache.py
U ZODB/trunk/src/persistent/tests/test_mapping.py
U ZODB/trunk/src/persistent/tests/test_overriding_attrs.py
U ZODB/trunk/src/persistent/tests/test_persistent.py
U ZODB/trunk/src/persistent/tests/test_pickle.py
U ZODB/trunk/src/persistent/tests/test_wref.py
-=-
Modified: ZODB/trunk/src/BTrees/tests/test_fsBTree.py
===================================================================
--- ZODB/trunk/src/BTrees/tests/test_fsBTree.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/BTrees/tests/test_fsBTree.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,8 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+import doctest
import unittest
-from zope.testing import doctest
def test_fsbucket_string_conversion():
"""
Modified: ZODB/trunk/src/ZEO/scripts/tests.py
===================================================================
--- ZODB/trunk/src/ZEO/scripts/tests.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZEO/scripts/tests.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,13 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""XXX short summary goes here.
+import doctest, re, unittest
+from zope.testing import renormalizing
-$Id$
-"""
-import re, unittest
-from zope.testing import doctest, renormalizing
-
def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite(
Modified: ZODB/trunk/src/ZEO/tests/testConnection.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testConnection.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZEO/tests/testConnection.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -16,9 +16,9 @@
The actual tests are in ConnectionTests.py; this file provides the
platform-dependent scaffolding.
"""
-
from ZEO.tests import ConnectionTests, InvalidationTests
-from zope.testing import doctest, setupstack
+from zope.testing import setupstack
+import doctest
import unittest
import ZEO.tests.forker
import ZEO.tests.testMonitor
Modified: ZODB/trunk/src/ZEO/tests/testConversionSupport.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testConversionSupport.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZEO/tests/testConversionSupport.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,8 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+import doctest
import unittest
-from zope.testing import doctest
class FakeStorageBase:
Modified: ZODB/trunk/src/ZEO/tests/testZEO2.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO2.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZEO/tests/testZEO2.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,7 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-from zope.testing import doctest, setupstack, renormalizing
+from zope.testing import setupstack, renormalizing
+import doctest
import logging
import pprint
import re
Modified: ZODB/trunk/src/ZEO/tests/test_cache.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/test_cache.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZEO/tests/test_cache.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -14,7 +14,7 @@
"""Basic unit tests for a client cache."""
from ZODB.utils import p64, repr_to_oid
-from zope.testing import doctest
+import doctest
import os
import random
import string
Modified: ZODB/trunk/src/ZODB/FileStorage/tests.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/tests.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/FileStorage/tests.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,10 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-
-from zope.testing import doctest
-
import cPickle
+import doctest
import os
import time
import transaction
Modified: ZODB/trunk/src/ZODB/scripts/tests/test_doc.py
===================================================================
--- ZODB/trunk/src/ZODB/scripts/tests/test_doc.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/scripts/tests/test_doc.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,17 +11,15 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Test harness for scripts.
-
-$Id$
-"""
-import unittest
+import doctest
import re
-from zope.testing import doctest, renormalizing
+import unittest
import ZODB.tests.util
+import zope.testing.renormalizing
-checker = renormalizing.RENormalizing([
- (re.compile('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+'),
+checker = zope.testing.renormalizing.RENormalizing([
+ (re.compile(
+ '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+'),
'2007-11-10 15:18:48.543001'),
(re.compile('hash=[0-9a-f]{40}'),
'hash=b16422d09fabdb45d4e4325e4b42d7d6f021d3c3')])
Modified: ZODB/trunk/src/ZODB/tests/PackableStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/PackableStorage.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/PackableStorage.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -22,8 +22,8 @@
from ZODB.tests.MinPO import MinPO
from ZODB.tests.MTStorage import TestThread
from ZODB.tests.StorageTestBase import snooze
-from zope.testing import doctest
import cPickle
+import doctest
import time
import transaction
import ZODB.interfaces
Modified: ZODB/trunk/src/ZODB/tests/sampledm.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/sampledm.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/sampledm.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -12,8 +12,6 @@
#
##############################################################################
"""Sample objects for use in tests
-
-$Id$
"""
class DataManager(object):
@@ -405,7 +403,7 @@
def test_suite():
- from zope.testing.doctest import DocTestSuite
+ from doctest import DocTestSuite
return DocTestSuite()
if __name__ == '__main__':
Modified: ZODB/trunk/src/ZODB/tests/testBroken.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testBroken.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testBroken.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -12,15 +12,13 @@
#
##############################################################################
"""Test broken-object suppport
-
-$Id$
"""
import sys
import unittest
import persistent
import transaction
-from zope.testing.doctest import DocTestSuite
+from doctest import DocTestSuite
from ZODB.tests.util import DB
def test_integration():
Modified: ZODB/trunk/src/ZODB/tests/testCache.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testCache.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testCache.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -23,7 +23,7 @@
from persistent.mapping import PersistentMapping
from ZODB.tests.MinPO import MinPO
from ZODB.utils import p64
-from zope.testing import doctest
+import doctest
import gc
import threading
import time
Modified: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,14 +11,10 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Tests of savepoint feature
-
-$Id$
-"""
-import unittest
-from zope.testing import doctest
+import doctest
import persistent.mapping
import transaction
+import unittest
def testAddingThenModifyThenAbort():
"""\
Modified: ZODB/trunk/src/ZODB/tests/testDB.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testDB.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testDB.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -13,8 +13,8 @@
##############################################################################
from ZODB.tests.MinPO import MinPO
-from zope.testing import doctest
import datetime
+import doctest
import os
import sys
import time
Modified: ZODB/trunk/src/ZODB/tests/testDemoStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testDemoStorage.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testDemoStorage.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,15 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import unittest
-import random
-import transaction
from ZODB.DB import DB
-from zope.testing import doctest
-import ZODB.tests.hexstorage
-import ZODB.tests.util
-import ZODB.utils
-import ZODB.DemoStorage
from ZODB.tests import (
BasicStorage,
HistoryStorage,
@@ -30,6 +22,14 @@
StorageTestBase,
Synchronization,
)
+import doctest
+import random
+import transaction
+import unittest
+import ZODB.DemoStorage
+import ZODB.tests.hexstorage
+import ZODB.tests.util
+import ZODB.utils
class DemoStorageTests(
StorageTestBase.StorageTestBase,
Modified: ZODB/trunk/src/ZODB/tests/testFileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testFileStorage.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testFileStorage.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -12,6 +12,7 @@
#
##############################################################################
import cPickle
+import doctest
import os, unittest
import transaction
import ZODB.FileStorage
@@ -657,8 +658,6 @@
"""
def test_suite():
- from zope.testing import doctest
-
suite = unittest.TestSuite()
for klass in [
FileStorageTests, FileStorageHexTests,
Modified: ZODB/trunk/src/ZODB/tests/testSerialize.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testSerialize.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testSerialize.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,8 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Tests of the serializer."""
-
+import doctest
import cPickle
import cStringIO as StringIO
import sys
@@ -121,7 +120,6 @@
def test_suite():
- from zope.testing import doctest
suite = unittest.makeSuite(SerializerTestCase)
suite.addTest(doctest.DocTestSuite("ZODB.serialize"))
return suite
Modified: ZODB/trunk/src/ZODB/tests/testUtils.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testUtils.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testUtils.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -13,10 +13,10 @@
##############################################################################
"""Test the routines to convert between long and 64-bit strings"""
+from persistent import Persistent
+import doctest
import random
import unittest
-from persistent import Persistent
-from zope.testing import doctest
NUM = 100
Modified: ZODB/trunk/src/ZODB/tests/test_cache.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/test_cache.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/test_cache.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -12,12 +12,10 @@
#
##############################################################################
"""Test behavior of Connection plus cPickleCache."""
-
-from zope.testing import doctest
-
from persistent import Persistent
-import transaction
from ZODB.config import databaseFromString
+import doctest
+import transaction
class RecalcitrantObject(Persistent):
"""A Persistent object that will not become a ghost."""
Modified: ZODB/trunk/src/ZODB/tests/test_datamanageradapter.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/test_datamanageradapter.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/test_datamanageradapter.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,11 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
-$Id$
-"""
import unittest
-from zope.testing.doctest import DocTestSuite
+from doctest import DocTestSuite
from transaction._transaction import DataManagerAdapter
from ZODB.tests.sampledm import DataManager
Modified: ZODB/trunk/src/ZODB/tests/test_doctest_files.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/test_doctest_files.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/test_doctest_files.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,13 +11,12 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-
+import doctest
import unittest
-from zope.testing import doctest
__test__ = dict(
cross_db_refs_to_blank_db_name = """
-
+
There was a bug that caused bad refs to be generated is a database
name was blank.
@@ -38,7 +37,7 @@
>>> list(conn2.root()[0].keys())
[]
-
+
""",
)
Modified: ZODB/trunk/src/ZODB/tests/test_fsdump.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/test_fsdump.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/test_fsdump.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -67,7 +67,7 @@
>>> st.close()
"""
-from zope.testing import doctest
+import doctest
import zope.testing.setupstack
def test_suite():
Modified: ZODB/trunk/src/ZODB/tests/testcrossdatabasereferences.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testcrossdatabasereferences.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testcrossdatabasereferences.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,12 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
-$Id$
-"""
-import unittest
-from zope.testing import doctest
+import doctest
import persistent
+import unittest
class MyClass(persistent.Persistent):
pass
Modified: ZODB/trunk/src/ZODB/tests/testfsoids.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testfsoids.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testfsoids.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-
r"""
fsoids test, of the workhorse fsoids.Trace class
================================================
@@ -168,7 +167,7 @@
>>> st.cleanup() # remove .fs, .index, etc
"""
-from zope.testing import doctest
+import doctest
def test_suite():
return doctest.DocTestSuite()
Modified: ZODB/trunk/src/ZODB/tests/testmvcc.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testmvcc.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testmvcc.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -402,7 +402,7 @@
1
"""
-from zope.testing import doctest
+import doctest
def test_suite():
return doctest.DocTestSuite()
Modified: ZODB/trunk/src/ZODB/tests/testpersistentclass.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testpersistentclass.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/ZODB/tests/testpersistentclass.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,17 +11,13 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""ZClass tests
-
-$Id$
-"""
-
-import os, sys
-import unittest
-import ZODB.tests.util
+import doctest
+import os
+import sys
import transaction
-from zope.testing import doctest
+import unittest
import ZODB.persistentclass
+import ZODB.tests.util
def class_with_circular_ref_to_self():
"""
@@ -41,7 +37,7 @@
>>> c = C2()
>>> c.__class__.__name__
'C'
-
+
"""
# XXX need to update files to get newer testing package
Modified: ZODB/trunk/src/persistent/tests/test_PickleCache.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_PickleCache.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_PickleCache.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,11 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Unit tests for PickleCache
-$Id$
-"""
-
class DummyConnection:
def setklassstate(self, obj):
@@ -114,7 +110,7 @@
"""
-from zope.testing.doctest import DocTestSuite
+from doctest import DocTestSuite
import unittest
def test_suite():
Modified: ZODB/trunk/src/persistent/tests/test_mapping.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_mapping.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_mapping.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,8 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+import doctest
import unittest
-from zope.testing import doctest, setupstack
+from zope.testing import setupstack
def test_suite():
return unittest.TestSuite((
Modified: ZODB/trunk/src/persistent/tests/test_overriding_attrs.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_overriding_attrs.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_overriding_attrs.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -15,8 +15,6 @@
This module tests and documents, through example, overriding attribute
access methods.
-
-$Id$
"""
from persistent import Persistent # ouch!
@@ -379,5 +377,5 @@
def test_suite():
- from zope.testing.doctest import DocTestSuite
+ from doctest import DocTestSuite
return DocTestSuite()
Modified: ZODB/trunk/src/persistent/tests/test_persistent.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_persistent.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_persistent.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,9 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
+from persistent import Persistent, simple_new
+import doctest
import unittest
-from zope.testing import doctest
-from persistent import Persistent, simple_new
class P(Persistent):
def __init__(self):
Modified: ZODB/trunk/src/persistent/tests/test_pickle.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_pickle.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_pickle.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,11 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Basic pickling tests
-
-$Id$
-"""
-
from persistent import Persistent
import pickle
@@ -269,7 +264,7 @@
"""
-from zope.testing.doctest import DocTestSuite
+from doctest import DocTestSuite
import unittest
def test_suite():
Modified: ZODB/trunk/src/persistent/tests/test_wref.py
===================================================================
--- ZODB/trunk/src/persistent/tests/test_wref.py 2010-05-18 19:35:17 UTC (rev 112483)
+++ ZODB/trunk/src/persistent/tests/test_wref.py 2010-05-18 19:44:11 UTC (rev 112484)
@@ -11,11 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
-$Id$
-"""
import unittest
-from zope.testing.doctest import DocTestSuite
+from doctest import DocTestSuite
def test_suite():
return DocTestSuite('persistent.wref')
More information about the Zodb-checkins
mailing list