~cjwatson/lazr.restful/py3-doctest-trivial

« back to all changes in this revision

Viewing changes to src/lazr/restful/tests/test_docs.py

  • Committer: Colin Watson
  • Date: 2020-09-02 15:19:32 UTC
  • mfrom: (254.2.1 py3-normalize-doctests)
  • Revision ID: cjwatson@canonical.com-20200902151932-1ngz7wkgcqlblko8
[r=ilasc] Make doctests of tracebacks work on both Python 2 and 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import os
28
28
from pkg_resources import (
29
29
    resource_filename, resource_exists, resource_listdir, cleanup_resources)
30
 
 
 
30
from zope.testing import renormalizing
31
31
from zope.testing.cleanup import cleanUp
32
32
 
33
33
 
37
37
    doctest.REPORT_NDIFF)
38
38
 
39
39
 
 
40
checker = renormalizing.OutputChecker()
 
41
 
 
42
 
40
43
def tearDown(test):
41
44
    """Run registered clean-up function."""
42
45
    cleanUp()
58
61
        }
59
62
    tests.addTest(doctest.DocFileSuite(
60
63
        *doctest_files, module_relative=False, optionflags=DOCTEST_FLAGS,
61
 
        tearDown=tearDown, globs=globs, encoding='UTF-8'))
 
64
        tearDown=tearDown, globs=globs, encoding='UTF-8', checker=checker))
62
65
    return tests