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/.
Features Added
++++++++++++++
- Use the standard libraries doctest module in favor of the deprecated version
in zope.testing.
- Updated packages:
- distribute = 0.6.10
......
......@@ -17,13 +17,13 @@ Well, at least begin testing some of the functionality
$Id$
"""
import doctest
import unittest
import os
import operator
import sys
from zope.testing import doctest
import ZODB
......
......@@ -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():
suite = unittest.TestSuite()
......
......@@ -31,7 +31,7 @@ def test_InitializeClass():
>>> InitializeClass(C)
"""
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
import unittest
def test_suite():
......
......@@ -36,7 +36,7 @@
$Id$
"""
import unittest
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
def test_suite():
return unittest.TestSuite((
......
......@@ -50,7 +50,7 @@
$Id$
"""
import unittest
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
def test_suite():
return unittest.TestSuite((
......
......@@ -49,5 +49,5 @@ def test_processInputs():
"""
def test_suite():
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
return DocTestSuite()
......@@ -86,5 +86,5 @@ def test_zpt_i18n():
def test_suite():
from Testing.ZopeTestCase import FunctionalDocTestSuite
from zope.testing.doctest import ELLIPSIS
from doctest import ELLIPSIS
return FunctionalDocTestSuite(optionflags=ELLIPSIS)
......@@ -55,5 +55,5 @@ def test_check_permission():
def test_suite():
from Testing.ZopeTestCase import FunctionalDocTestSuite
from zope.testing.doctest import ELLIPSIS
from doctest import ELLIPSIS
return FunctionalDocTestSuite(optionflags=ELLIPSIS)
......@@ -16,7 +16,7 @@
$Id$
"""
import unittest
from zope.testing.doctestunit import DocFileSuite
from doctest import DocFileSuite
from Testing.ZopeTestCase import FunctionalDocFileSuite
__docformat__ = "reStructuredText"
......
......@@ -83,6 +83,6 @@ class MyNewFolder(DontComplain, Folder):
def test_suite():
from zope.testing.doctest import DocFileSuite
from doctest import DocFileSuite
return DocFileSuite('event.txt', package="Products.Five.tests",
setUp=setUp, tearDown=testing.tearDown)
......@@ -55,5 +55,5 @@ def test_directive():
def test_suite():
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
return DocTestSuite(setUp=setUp, tearDown=tearDown)
......@@ -48,7 +48,7 @@ def test_editview():
Try to add a marker interface that doesn't exist:
>>> view.update(('__builtin__.IFooMarker',), ())
>>> view.update(('__main__.IFooMarker',), ())
Traceback (most recent call last):
...
ComponentLookupError...
......@@ -66,7 +66,7 @@ def test_editview():
And try again to add it to the object:
>>> view.update(('__builtin__.IFooMarker',), ())
>>> view.update(('__main__.IFooMarker',), ())
>>> view.getAvailableInterfaceNames()
[]
>>> view.getDirectlyProvidedNames()
......@@ -74,7 +74,7 @@ def test_editview():
And remove it again:
>>> view.update((), ('__builtin__.IFooMarker',))
>>> view.update((), ('__main__.IFooMarker',))
>>> view.getAvailableInterfaceNames()
[...IFooMarker...]
>>> view.getDirectlyProvidedNames()
......
......@@ -15,7 +15,5 @@
$Id$
"""
from zope.testing.doctest import *
from zope.testing.doctest import _normalize_module
from doctest import *
from functional import *
......@@ -15,11 +15,13 @@
$Id$
"""
import sys, re, base64
import base64
import doctest
import re
import sys
import warnings
import transaction
from zope.testing import doctest
import transaction
from Testing.ZopeTestCase import ZopeTestCase
from Testing.ZopeTestCase import FunctionalTestCase
......@@ -93,7 +95,6 @@ basicre = re.compile('Basic (.+)?:(.+)?$')
def auth_header(header):
match = basicre.match(header)
if match:
import base64
u, p = match.group(1, 2)
if u is None:
u = ''
......
......@@ -57,7 +57,7 @@ $Id: tests.py,v 1.2 2003/11/28 16:46:39 jim Exp $
import ThreadLock, threading, time
import unittest
from zope.testing.doctest import DocTestSuite
from doctest import DocTestSuite
def test_suite():
return unittest.TestSuite((
......
......@@ -133,7 +133,8 @@ def testBeforeTraverse(self):
"""
pass
from zope.testing import doctest
import doctest
def test_suite():
return doctest.DocTestSuite(optionflags=doctest.ELLIPSIS)
......@@ -391,7 +391,7 @@ def testPublishPath():
pass
from zope.testing import doctest
import doctest
def test_suite():
return doctest.DocTestSuite()
......@@ -133,7 +133,7 @@ zope.structuredtext = 3.4.0
zope.tal = 3.5.2
zope.tales = 3.4.0
zope.testbrowser = 3.6.0a2
zope.testing = 3.7.7
zope.testing = 3.9.4
zope.thread = 3.4
zope.traversing = 3.7.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