~paulegan/flufl.bounce/caiwireless-bug-917720

« back to all changes in this revision

Viewing changes to flufl/bounce/tests/test_documentation.py

  • Committer: Barry Warsaw
  • Date: 2012-01-04 16:39:36 UTC
  • Revision ID: barry@python.org-20120104163936-qrrd7ipqrprpxwvp
 * Port to Python 3 is mostly complete, however the test suite current fails
   because of <https://bugs.launchpad.net/zope.interface/+bug/911851>.  Once
   that bug is fixed in `zope.interface`, `flufl.bounce` should be Python 3.2
   compatible without the need for `2to3`.
 * All returned addresses are bytes objects in Python 3 and 8-bit strings in
   Python 2 (no change there).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Test harness for doctests."""
19
19
 
20
 
from __future__ import absolute_import, unicode_literals
 
20
from __future__ import absolute_import, print_function, unicode_literals
21
21
 
22
22
__metaclass__ = type
23
23
__all__ = [
30
30
import doctest
31
31
import unittest
32
32
 
 
33
try:
 
34
    # Python 3
 
35
    from email import message_from_bytes as parse
 
36
except ImportError:
 
37
    # Python 2
 
38
    from email import message_from_string as parse
 
39
 
33
40
from pkg_resources import (
34
41
    resource_filename, resource_exists, resource_listdir, cleanup_resources)
35
42
 
61
68
    # defined.
62
69
    try:
63
70
        testobj.globs['absolute_import'] = absolute_import
 
71
        testobj.globs['print_function'] = print_function
64
72
        testobj.globs['unicode_literals'] = unicode_literals
65
73
    except NameError:
66
74
        pass
67
75
    testobj.globs['stop'] = stop
 
76
    testobj.globs['parse'] = parse
68
77
 
69
78
 
70
79