Commit c5162ffc authored by Hanno Schlichting's avatar Hanno Schlichting

Updated to the latest zope.testing and backport the deprecation avoidance...

Updated to the latest zope.testing and backport the deprecation avoidance changes for zope.testing.doctest
parent 16304e07
...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/. ...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Features Added Features Added
++++++++++++++ ++++++++++++++
- Use the standard libraries doctest module in favor of the deprecated version
in zope.testing.
- Updated packages: - Updated packages:
- distribute = 0.6.10 - distribute = 0.6.10
......
...@@ -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((
......
...@@ -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)
...@@ -55,5 +55,5 @@ def test_check_permission(): ...@@ -55,5 +55,5 @@ def test_check_permission():
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"
......
...@@ -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="Products.Five.tests", return DocFileSuite('event.txt', package="Products.Five.tests",
setUp=setUp, tearDown=testing.tearDown) setUp=setUp, tearDown=testing.tearDown)
...@@ -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)
...@@ -48,7 +48,7 @@ def test_editview(): ...@@ -48,7 +48,7 @@ def test_editview():
Try to add a marker interface that doesn't exist: Try to add a marker interface that doesn't exist:
>>> view.update(('__builtin__.IFooMarker',), ()) >>> view.update(('__main__.IFooMarker',), ())
Traceback (most recent call last): Traceback (most recent call last):
... ...
ComponentLookupError... ComponentLookupError...
...@@ -66,7 +66,7 @@ def test_editview(): ...@@ -66,7 +66,7 @@ def test_editview():
And try again to add it to the object: And try again to add it to the object:
>>> view.update(('__builtin__.IFooMarker',), ()) >>> view.update(('__main__.IFooMarker',), ())
>>> view.getAvailableInterfaceNames() >>> view.getAvailableInterfaceNames()
[] []
>>> view.getDirectlyProvidedNames() >>> view.getDirectlyProvidedNames()
...@@ -74,7 +74,7 @@ def test_editview(): ...@@ -74,7 +74,7 @@ def test_editview():
And remove it again: And remove it again:
>>> view.update((), ('__builtin__.IFooMarker',)) >>> view.update((), ('__main__.IFooMarker',))
>>> view.getAvailableInterfaceNames() >>> view.getAvailableInterfaceNames()
[...IFooMarker...] [...IFooMarker...]
>>> view.getDirectlyProvidedNames() >>> view.getDirectlyProvidedNames()
......
...@@ -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()
...@@ -133,7 +133,7 @@ zope.structuredtext = 3.4.0 ...@@ -133,7 +133,7 @@ zope.structuredtext = 3.4.0
zope.tal = 3.5.2 zope.tal = 3.5.2
zope.tales = 3.4.0 zope.tales = 3.4.0
zope.testbrowser = 3.6.0a2 zope.testbrowser = 3.6.0a2
zope.testing = 3.7.7 zope.testing = 3.9.4
zope.thread = 3.4 zope.thread = 3.4
zope.traversing = 3.7.1 zope.traversing = 3.7.1
zope.viewlet = 3.6.1 zope.viewlet = 3.6.1
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