~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Andrew Bennetts
  • Date: 2010-12-14 23:14:44 UTC
  • mfrom: (5569 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5570.
  • Revision ID: andrew.bennetts@canonical.com-20101214231444-uubf7zjbg8q92ocs
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
import testtools
56
56
# nb: check this before importing anything else from within it
57
57
_testtools_version = getattr(testtools, '__version__', ())
58
 
if _testtools_version < (0, 9, 2):
59
 
    raise ImportError("need at least testtools 0.9.2: %s is %r"
 
58
if _testtools_version < (0, 9, 5):
 
59
    raise ImportError("need at least testtools 0.9.5: %s is %r"
60
60
        % (testtools.__file__, _testtools_version))
61
61
from testtools import content
62
62
 
651
651
            encode = codec[0]
652
652
        else:
653
653
            encode = codec.encode
654
 
        stream = osutils.UnicodeOrBytesToBytesWriter(encode, stream)
 
654
        # GZ 2010-09-08: Really we don't want to be writing arbitrary bytes,
 
655
        #                so should swap to the plain codecs.StreamWriter
 
656
        stream = osutils.UnicodeOrBytesToBytesWriter(encode, stream,
 
657
            "backslashreplace")
655
658
        stream.encoding = new_encoding
656
659
        self.stream = stream
657
660
        self.descriptions = descriptions