[Zope-Checkins] SVN: Zope/branches/jim-fix-zclasses/lib/python/ Use newer doctest

Jim Fulton jim at zope.com
Fri Apr 1 06:24:20 EST 2005


Log message for revision 29771:
  Use newer doctest
  

Changed:
  U   Zope/branches/jim-fix-zclasses/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
  U   Zope/branches/jim-fix-zclasses/lib/python/Acquisition/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ComputedAttribute/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ExtensionClass/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/MethodObject/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/Missing/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/MultiMapping/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_ExtensionClass.py
  U   Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_mapping.py
  U   Zope/branches/jim-fix-zclasses/lib/python/Record/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ThreadLock/tests.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/sampledm.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testBroken.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testConnection.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testFileStorage.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSerialize.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSubTransaction.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_cache.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_datamanageradapter.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testmvcc.py
  U   Zope/branches/jim-fix-zclasses/lib/python/ZPublisher/tests/testPublish.py
  U   Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_PickleCache.py
  U   Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_overriding_attrs.py
  U   Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_persistent.py
  U   Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_pickle.py
  U   Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_wref.py
  U   Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_SampleDataManager.py
  U   Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_register_compat.py
  U   Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_transaction.py
  U   Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_util.py

-=-
Modified: Zope/branches/jim-fix-zclasses/lib/python/AccessControl/tests/testZopeSecurityPolicy.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/AccessControl/tests/testZopeSecurityPolicy.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/AccessControl/tests/testZopeSecurityPolicy.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -495,7 +495,7 @@
     
     """
 
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     suite = unittest.TestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/Acquisition/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/Acquisition/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/Acquisition/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -1527,7 +1527,7 @@
     
 
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return unittest.TestSuite((

Modified: Zope/branches/jim-fix-zclasses/lib/python/ComputedAttribute/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ComputedAttribute/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ComputedAttribute/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -66,7 +66,7 @@
     """
 
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 from ExtensionClass import Base
 from ComputedAttribute import ComputedAttribute
 

Modified: Zope/branches/jim-fix-zclasses/lib/python/ExtensionClass/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ExtensionClass/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ExtensionClass/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -737,7 +737,7 @@
     """
 
 
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 import unittest
 
 def test_suite():

Modified: Zope/branches/jim-fix-zclasses/lib/python/MethodObject/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/MethodObject/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/MethodObject/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_xxx():
     """

Modified: Zope/branches/jim-fix-zclasses/lib/python/Missing/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/Missing/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/Missing/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -36,7 +36,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return unittest.TestSuite((

Modified: Zope/branches/jim-fix-zclasses/lib/python/MultiMapping/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/MultiMapping/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/MultiMapping/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -50,7 +50,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return unittest.TestSuite((

Modified: Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_ExtensionClass.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_ExtensionClass.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_ExtensionClass.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 import pickle
 
 from Persistence import Persistent

Modified: Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_mapping.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_mapping.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/Persistence/tests/test_mapping.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 from Persistence import PersistentMapping
 
 def test_basic_functionality():

Modified: Zope/branches/jim-fix-zclasses/lib/python/Record/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/Record/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/Record/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -39,7 +39,7 @@
     """
 
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return unittest.TestSuite((

Modified: Zope/branches/jim-fix-zclasses/lib/python/ThreadLock/tests.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ThreadLock/tests.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ThreadLock/tests.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -57,7 +57,7 @@
 
 import ThreadLock, threading, time
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return unittest.TestSuite((

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/sampledm.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/sampledm.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/sampledm.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -405,7 +405,7 @@
 
 
 def test_suite():
-    from doctest import DocTestSuite
+    from zope.testing.doctest import DocTestSuite
     return DocTestSuite()
 
 if __name__ == '__main__':

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testBroken.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testBroken.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testBroken.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -20,7 +20,7 @@
 import unittest
 import persistent
 import transaction
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 from ZODB.tests.util import DB
 
 def test_integration():

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testConnection.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testConnection.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testConnection.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -13,7 +13,7 @@
 ##############################################################################
 """Unit tests for the Connection class."""
 
-import doctest
+from zope.testing import doctest
 import unittest
 import warnings
 

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testFileStorage.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testFileStorage.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testFileStorage.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -350,7 +350,7 @@
     """
 
 def test_suite():
-    import doctest
+    from zope.testing import doctest
 
     suite = unittest.TestSuite()
     for klass in [FileStorageTests, Corruption.FileStorageCorruptTests,

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSerialize.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSerialize.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSerialize.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -118,7 +118,7 @@
 
 
 def test_suite():
-    import doctest
+    from zope.testing import doctest
     suite = unittest.makeSuite(SerializerTestCase)
     suite.addTest(doctest.DocTestSuite("ZODB.serialize"))
     return suite

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSubTransaction.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSubTransaction.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testSubTransaction.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -132,7 +132,7 @@
 
 """
 
-import doctest
+from zope.testing import doctest
 
 def test_suite():
     return doctest.DocTestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_cache.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_cache.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_cache.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -13,7 +13,7 @@
 ##############################################################################
 """Test behavior of Connection plus cPickleCache."""
 
-import doctest
+from zope.testing import doctest
 
 from persistent import Persistent
 import transaction

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_datamanageradapter.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_datamanageradapter.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/test_datamanageradapter.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 from transaction._transaction import DataManagerAdapter
 from ZODB.tests.sampledm import DataManager
 

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testmvcc.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testmvcc.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZODB/tests/testmvcc.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -358,7 +358,7 @@
 
 """
 
-import doctest
+from zope.testing import doctest
 
 def test_suite():
     return doctest.DocTestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/ZPublisher/tests/testPublish.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/ZPublisher/tests/testPublish.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/ZPublisher/tests/testPublish.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -267,7 +267,7 @@
     pass
 
 
-import doctest
+from zope.testing import doctest
 
 def test_suite():
     return doctest.DocTestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_PickleCache.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_PickleCache.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_PickleCache.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -40,7 +40,7 @@
 
     """
 
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 import unittest
 
 def test_suite():

Modified: Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_overriding_attrs.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_overriding_attrs.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_overriding_attrs.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -398,5 +398,5 @@
 
 
 def test_suite():
-    from doctest import DocTestSuite
+    from zope.testing.doctest import DocTestSuite
     return DocTestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_persistent.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_persistent.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_persistent.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-import doctest
+from zope.testing import doctest
 import os
 import sys
 import unittest
@@ -25,30 +25,5 @@
     def inc(self):
         self.x += 1
 
-try:
-    DocFileSuite = doctest.DocFileSuite # >= Python 2.4.0a2
-except AttributeError:
-    # <= Python 2.4.0a1
-    def DocFileSuite(path, globs=None):
-        # It's not entirely obvious how to connection this single string
-        # with unittest.  For now, re-use the _utest() function that comes
-        # standard with doctest in Python 2.3.  One problem is that the
-        # error indicator doesn't point to the line of the doctest file
-        # that failed.
-
-        path = os.path.join(persistent.tests.__path__[0], path)
-
-        source = open(path).read()
-        if globs is None:
-            globs = sys._getframe(1).f_globals
-        t = doctest.Tester(globs=globs)
-        def runit():
-            doctest._utest(t, path, source, path, 0)
-        f = unittest.FunctionTestCase(runit,
-                                      description="doctest from %s" % path)
-        suite = unittest.TestSuite()
-        suite.addTest(f)
-        return suite
-
 def test_suite():
-    return DocFileSuite("persistent.txt", globs={"P": P})
+    return doctest.DocFileSuite("persistent.txt", globs={"P": P})

Modified: Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_pickle.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_pickle.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_pickle.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -276,7 +276,7 @@
 
     """
 
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 import unittest
 
 def test_suite():

Modified: Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_wref.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_wref.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/persistent/tests/test_wref.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return DocTestSuite('persistent.wref')

Modified: Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_SampleDataManager.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_SampleDataManager.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_SampleDataManager.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -405,7 +405,7 @@
 
 
 def test_suite():
-    from doctest import DocTestSuite
+    from zope.testing.doctest import DocTestSuite
     return DocTestSuite()
 
 if __name__ == '__main__':

Modified: Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_register_compat.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_register_compat.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_register_compat.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -148,7 +148,7 @@
         obj.abort()
         self.aborted.append(obj)
 
-import doctest
+from zope.testing import doctest
 
 def test_suite():
     return doctest.DocTestSuite()

Modified: Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_transaction.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_transaction.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_transaction.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -636,7 +636,7 @@
     """
 
 def test_suite():
-    from doctest import DocTestSuite
+    from zope.testing.doctest import DocTestSuite
     return unittest.TestSuite((
         DocTestSuite(),
         unittest.makeSuite(TransactionTests),

Modified: Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_util.py
===================================================================
--- Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_util.py	2005-04-01 03:05:06 UTC (rev 29770)
+++ Zope/branches/jim-fix-zclasses/lib/python/transaction/tests/test_util.py	2005-04-01 11:24:20 UTC (rev 29771)
@@ -16,7 +16,7 @@
 $Id$
 """
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocTestSuite
 
 def test_suite():
     return DocTestSuite('transaction.util')



More information about the Zope-Checkins mailing list