← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:remove-zope.testing.renormalizing into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:remove-zope.testing.renormalizing into launchpad:master.

Commit message:
Remove most uses of zope.testing.renormalizing

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/407201

We were mainly using this module for the `IGNORE_EXCEPTION_MODULE_IN_PYTHON2` option flag, but we no longer need that.  `lp.services.mail.tests.test_stub` still has a legitimate use for this module, since it does regex substitution on the output of one example.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:remove-zope.testing.renormalizing into launchpad:master.
diff --git a/lib/lp/app/validators/tests/test_validators.py b/lib/lp/app/validators/tests/test_validators.py
index b83c481..af97c8a 100644
--- a/lib/lp/app/validators/tests/test_validators.py
+++ b/lib/lp/app/validators/tests/test_validators.py
@@ -12,8 +12,6 @@ from doctest import (
     )
 from unittest import TestSuite
 
-from zope.testing.renormalizing import OutputChecker
-
 from lp.testing.layers import LaunchpadFunctionalLayer
 from lp.testing.systemdocs import (
     setUp,
@@ -51,7 +49,7 @@ def suitefor(module):
     """Make a doctest suite with common setUp and tearDown functions."""
     suite = DocTestSuite(
         module, setUp=setUp, tearDown=tearDown,
-        optionflags=ELLIPSIS | NORMALIZE_WHITESPACE, checker=OutputChecker())
+        optionflags=ELLIPSIS | NORMALIZE_WHITESPACE)
     # We have to invoke the LaunchpadFunctionalLayer in order to
     # initialize the ZCA machinery, which is a pre-requisite for using
     # login().
diff --git a/lib/lp/app/widgets/tests/test_widget_doctests.py b/lib/lp/app/widgets/tests/test_widget_doctests.py
index d301a14..cbad1dc 100644
--- a/lib/lp/app/widgets/tests/test_widget_doctests.py
+++ b/lib/lp/app/widgets/tests/test_widget_doctests.py
@@ -6,8 +6,6 @@ __metaclass__ = type
 import doctest
 import unittest
 
-from zope.testing.renormalizing import OutputChecker
-
 from lp.testing.layers import DatabaseFunctionalLayer
 
 
@@ -15,6 +13,5 @@ def test_suite():
     suite = unittest.TestSuite()
     suite.layer = DatabaseFunctionalLayer
     suite.addTest(doctest.DocTestSuite('lp.app.widgets.textwidgets'))
-    suite.addTest(doctest.DocTestSuite(
-        'lp.app.widgets.date', checker=OutputChecker()))
+    suite.addTest(doctest.DocTestSuite('lp.app.widgets.date'))
     return suite
diff --git a/lib/lp/registry/tests/test_doc_project.py b/lib/lp/registry/tests/test_doc_project.py
index 0e9aaa0..dd4b773 100644
--- a/lib/lp/registry/tests/test_doc_project.py
+++ b/lib/lp/registry/tests/test_doc_project.py
@@ -6,7 +6,6 @@ __metaclass__ = type
 from doctest import DocTestSuite
 
 from zope.component import getUtility
-from zope.testing.renormalizing import OutputChecker
 
 from lp.testing import (
     ANONYMOUS,
@@ -21,7 +20,6 @@ def setUp(test):
 
 
 def test_suite():
-    suite = DocTestSuite(
-        'lp.registry.model.projectgroup', setUp=setUp, checker=OutputChecker())
+    suite = DocTestSuite('lp.registry.model.projectgroup', setUp=setUp)
     suite.layer = LaunchpadFunctionalLayer
     return suite
diff --git a/lib/lp/services/tests/test_helpers.py b/lib/lp/services/tests/test_helpers.py
index 4a1aa84..ff3d68e 100644
--- a/lib/lp/services/tests/test_helpers.py
+++ b/lib/lp/services/tests/test_helpers.py
@@ -5,8 +5,6 @@ from doctest import DocTestSuite
 from textwrap import dedent
 import unittest
 
-from zope.testing.renormalizing import OutputChecker
-
 from lp.services import helpers
 from lp.services.tarfile_helpers import LaunchpadWriteTarFile
 
@@ -192,7 +190,7 @@ class TruncateTextTest(unittest.TestCase):
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(DocTestSuite())
-    suite.addTest(DocTestSuite(helpers, checker=OutputChecker()))
+    suite.addTest(DocTestSuite(helpers))
     suite.addTest(
         unittest.TestLoader().loadTestsFromTestCase(TruncateTextTest))
     return suite
diff --git a/lib/lp/testing/systemdocs.py b/lib/lp/testing/systemdocs.py
index 43abf79..f7d30b5 100644
--- a/lib/lp/testing/systemdocs.py
+++ b/lib/lp/testing/systemdocs.py
@@ -27,7 +27,6 @@ import six
 import transaction
 from zope.component import getUtility
 from zope.testing.loggingsupport import Handler
-from zope.testing.renormalizing import OutputChecker
 
 from lp.services.config import config
 from lp.services.database.sqlbase import flush_database_updates
@@ -81,9 +80,6 @@ class FilePrefixStrippingDocTestParser(doctest.DocTestParser):
 default_parser = FilePrefixStrippingDocTestParser()
 
 
-default_checker = OutputChecker()
-
-
 class StdoutHandler(Handler):
     """A logging handler that prints log messages to sys.stdout.
 
@@ -150,7 +146,6 @@ def LayeredDocFileSuite(paths, id_extensions=None, **kw):
         id_extensions = []
     kw.setdefault('optionflags', default_optionflags)
     kw.setdefault('parser', default_parser)
-    kw.setdefault('checker', default_checker)
 
     # Make sure that paths are resolved relative to our caller
     kw['package'] = doctest._normalize_module(kw.get('package'))
diff --git a/lib/lp/translations/utilities/tests/test_gettext_po_parser.py b/lib/lp/translations/utilities/tests/test_gettext_po_parser.py
index ad3619e..dc52b7a 100644
--- a/lib/lp/translations/utilities/tests/test_gettext_po_parser.py
+++ b/lib/lp/translations/utilities/tests/test_gettext_po_parser.py
@@ -5,8 +5,6 @@ import doctest
 import re
 import unittest
 
-from zope.testing.renormalizing import OutputChecker
-
 from lp.translations.interfaces.translationimporter import (
     TranslationFormatInvalidInputError,
     TranslationFormatSyntaxError,
@@ -454,7 +452,7 @@ class POBasicTestCase(unittest.TestCase):
 
 def test_suite():
     # Run gettext PO parser doc tests.
-    dt_suite = doctest.DocTestSuite(gettext_po_parser, checker=OutputChecker())
+    dt_suite = doctest.DocTestSuite(gettext_po_parser)
     loader = unittest.TestLoader()
     ut_suite = loader.loadTestsFromTestCase(POBasicTestCase)
     return unittest.TestSuite((ut_suite, dt_suite))