Commit 3ea253ad authored by Jim Fulton's avatar Jim Fulton

Use doctest rather than zope.testing.doctest.

parent fad58f34
......@@ -11,8 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import doctest
import unittest
from zope.testing import doctest
def test_fsbucket_string_conversion():
"""
......
......@@ -11,12 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""XXX short summary goes here.
$Id$
"""
import re, unittest
from zope.testing import doctest, renormalizing
import doctest, re, unittest
from zope.testing import renormalizing
def test_suite():
return unittest.TestSuite((
......
......@@ -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
......
......@@ -11,8 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import doctest
import unittest
from zope.testing import doctest
class FakeStorageBase:
......
......@@ -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
......
......@@ -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
......
......@@ -11,10 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from zope.testing import doctest
import cPickle
import doctest
import os
import time
import transaction
......
......@@ -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')])
......
......@@ -22,8 +22,8 @@ from ZODB.serialize import referencesf
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
......
......@@ -12,8 +12,6 @@
#
##############################################################################
"""Sample objects for use in tests
$Id$
"""
class DataManager(object):
......@@ -405,7 +403,7 @@ class Rollback(object):
def test_suite():
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
return DocTestSuite()
if __name__ == '__main__':
......
......@@ -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():
......
......@@ -23,7 +23,7 @@ from persistent import Persistent
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
......
......@@ -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():
"""\
......
......@@ -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
......
......@@ -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 @@ from ZODB.tests import (
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,
......
......@@ -12,6 +12,7 @@
#
##############################################################################
import cPickle
import doctest
import os, unittest
import transaction
import ZODB.FileStorage
......@@ -657,8 +658,6 @@ def pack_with_open_blob_files():
"""
def test_suite():
from zope.testing import doctest
suite = unittest.TestSuite()
for klass in [
FileStorageTests, FileStorageHexTests,
......
......@@ -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 @@ class SerializerTestCase(unittest.TestCase):
def test_suite():
from zope.testing import doctest
suite = unittest.makeSuite(SerializerTestCase)
suite.addTest(doctest.DocTestSuite("ZODB.serialize"))
return suite
......@@ -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
......
......@@ -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."""
......
......@@ -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
......
......@@ -11,9 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import doctest
import unittest
from zope.testing import doctest
__test__ = dict(
cross_db_refs_to_blank_db_name = """
......
......@@ -67,7 +67,7 @@ Clean up.
>>> st.close()
"""
from zope.testing import doctest
import doctest
import zope.testing.setupstack
def test_suite():
......
......@@ -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
......
......@@ -11,7 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
r"""
fsoids test, of the workhorse fsoids.Trace class
================================================
......@@ -168,7 +167,7 @@ Clean up.
>>> st.cleanup() # remove .fs, .index, etc
"""
from zope.testing import doctest
import doctest
def test_suite():
return doctest.DocTestSuite()
......@@ -402,7 +402,7 @@ True
1
"""
from zope.testing import doctest
import doctest
def test_suite():
return doctest.DocTestSuite()
......@@ -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():
"""
......
......@@ -11,10 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Unit tests for PickleCache
$Id$
"""
class DummyConnection:
......@@ -114,7 +110,7 @@ Peristent meta classes work too:
"""
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
import unittest
def test_suite():
......
......@@ -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((
......
......@@ -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 @@ class SampleOverridingGetattributeSetattrAndDelattr(Persistent):
def test_suite():
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
return DocTestSuite()
......@@ -11,9 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import unittest
from zope.testing import doctest
from persistent import Persistent, simple_new
import doctest
import unittest
class P(Persistent):
def __init__(self):
......
......@@ -11,11 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Basic pickling tests
$Id$
"""
from persistent import Persistent
import pickle
......@@ -269,7 +264,7 @@ def test_pickling_w_slots_w_empty_dict():
"""
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
import unittest
def test_suite():
......
......@@ -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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment