Commit 002c497f authored by Hanno Schlichting's avatar Hanno Schlichting

Use the standard libraries doctest module in favor of the deprecated version in zope.testing

parent b505fb29
...@@ -11,6 +11,9 @@ Trunk (unreleased) ...@@ -11,6 +11,9 @@ Trunk (unreleased)
Restructuring Restructuring
+++++++++++++ +++++++++++++
- Use the standard libraries doctest module in favor of the deprecated version
in zope.testing.
- Finished the move of five.formlib to an extra package and removed it from - Finished the move of five.formlib to an extra package and removed it from
Zope 2 itself. Upgrade notes have been added to the news section of the Zope 2 itself. Upgrade notes have been added to the news section of the
release notes. release notes.
......
...@@ -17,13 +17,13 @@ Well, at least begin testing some of the functionality ...@@ -17,13 +17,13 @@ Well, at least begin testing some of the functionality
$Id$ $Id$
""" """
import doctest
import unittest import unittest
import os import os
import operator import operator
import sys import sys
from zope.testing import doctest
import ZODB import ZODB
......
...@@ -574,7 +574,7 @@ def test_zsp_gets_right_roles_for_methods(): ...@@ -574,7 +574,7 @@ def test_zsp_gets_right_roles_for_methods():
""" """
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
...@@ -31,7 +31,7 @@ def test_InitializeClass(): ...@@ -31,7 +31,7 @@ def test_InitializeClass():
>>> InitializeClass(C) >>> InitializeClass(C)
""" """
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
import unittest import unittest
def test_suite(): def test_suite():
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
$Id$ $Id$
""" """
import unittest import unittest
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
$Id$ $Id$
""" """
import unittest import unittest
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
......
...@@ -83,6 +83,6 @@ class MyNewFolder(DontComplain, Folder): ...@@ -83,6 +83,6 @@ class MyNewFolder(DontComplain, Folder):
def test_suite(): def test_suite():
from zope.testing.doctest import DocFileSuite from doctest import DocFileSuite
return DocFileSuite('event.txt', package="OFS.tests", return DocFileSuite('event.txt', package="OFS.tests",
setUp=setUp, tearDown=testing.tearDown) setUp=setUp, tearDown=testing.tearDown)
...@@ -49,5 +49,5 @@ def test_processInputs(): ...@@ -49,5 +49,5 @@ def test_processInputs():
""" """
def test_suite(): def test_suite():
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
return DocTestSuite() return DocTestSuite()
...@@ -86,5 +86,5 @@ def test_zpt_i18n(): ...@@ -86,5 +86,5 @@ def test_zpt_i18n():
def test_suite(): def test_suite():
from Testing.ZopeTestCase import FunctionalDocTestSuite from Testing.ZopeTestCase import FunctionalDocTestSuite
from zope.testing.doctest import ELLIPSIS from doctest import ELLIPSIS
return FunctionalDocTestSuite(optionflags=ELLIPSIS) return FunctionalDocTestSuite(optionflags=ELLIPSIS)
...@@ -129,5 +129,5 @@ def test_allowed_interface(): ...@@ -129,5 +129,5 @@ def test_allowed_interface():
def test_suite(): def test_suite():
from Testing.ZopeTestCase import FunctionalDocTestSuite from Testing.ZopeTestCase import FunctionalDocTestSuite
from zope.testing.doctest import ELLIPSIS from doctest import ELLIPSIS
return FunctionalDocTestSuite(optionflags=ELLIPSIS) return FunctionalDocTestSuite(optionflags=ELLIPSIS)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
$Id$ $Id$
""" """
import unittest import unittest
from zope.testing.doctestunit import DocFileSuite from doctest import DocFileSuite
from Testing.ZopeTestCase import FunctionalDocFileSuite from Testing.ZopeTestCase import FunctionalDocFileSuite
__docformat__ = "reStructuredText" __docformat__ = "reStructuredText"
......
...@@ -55,5 +55,5 @@ def test_directive(): ...@@ -55,5 +55,5 @@ def test_directive():
def test_suite(): def test_suite():
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
return DocTestSuite(setUp=setUp, tearDown=tearDown) return DocTestSuite(setUp=setUp, tearDown=tearDown)
...@@ -15,7 +15,5 @@ ...@@ -15,7 +15,5 @@
$Id$ $Id$
""" """
from zope.testing.doctest import * from doctest import *
from zope.testing.doctest import _normalize_module
from functional import * from functional import *
...@@ -15,11 +15,13 @@ ...@@ -15,11 +15,13 @@
$Id$ $Id$
""" """
import sys, re, base64 import base64
import doctest
import re
import sys
import warnings import warnings
import transaction
from zope.testing import doctest import transaction
from Testing.ZopeTestCase import ZopeTestCase from Testing.ZopeTestCase import ZopeTestCase
from Testing.ZopeTestCase import FunctionalTestCase from Testing.ZopeTestCase import FunctionalTestCase
...@@ -93,7 +95,6 @@ basicre = re.compile('Basic (.+)?:(.+)?$') ...@@ -93,7 +95,6 @@ basicre = re.compile('Basic (.+)?:(.+)?$')
def auth_header(header): def auth_header(header):
match = basicre.match(header) match = basicre.match(header)
if match: if match:
import base64
u, p = match.group(1, 2) u, p = match.group(1, 2)
if u is None: if u is None:
u = '' u = ''
......
...@@ -57,7 +57,7 @@ $Id: tests.py,v 1.2 2003/11/28 16:46:39 jim Exp $ ...@@ -57,7 +57,7 @@ $Id: tests.py,v 1.2 2003/11/28 16:46:39 jim Exp $
import ThreadLock, threading, time import ThreadLock, threading, time
import unittest import unittest
from zope.testing.doctest import DocTestSuite from doctest import DocTestSuite
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
......
...@@ -133,7 +133,8 @@ def testBeforeTraverse(self): ...@@ -133,7 +133,8 @@ def testBeforeTraverse(self):
""" """
pass pass
from zope.testing import doctest
import doctest
def test_suite(): def test_suite():
return doctest.DocTestSuite(optionflags=doctest.ELLIPSIS) return doctest.DocTestSuite(optionflags=doctest.ELLIPSIS)
...@@ -391,7 +391,7 @@ def testPublishPath(): ...@@ -391,7 +391,7 @@ def testPublishPath():
pass pass
from zope.testing import doctest import doctest
def test_suite(): def test_suite():
return doctest.DocTestSuite() return doctest.DocTestSuite()
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