~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__bencode.py

  • Committer: Andrew Bennetts
  • Date: 2010-09-17 04:32:50 UTC
  • mto: This revision was merged to the branch mainline in revision 5433.
  • Revision ID: andrew.bennetts@canonical.com-20100917043250-4f57ifkg0yu321t7
Reuse self._log_file rather than make new StringIO, and wrap pre-existing long line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for bencode structured encoding"""
18
18
 
19
19
import sys
20
 
from cStringIO import StringIO
21
20
 
22
21
from bzrlib import tests
23
22
 
113
112
        # to running out of stack space while evaluating "except (...):" in
114
113
        # _bencode_py.  This is harmless, so we temporarily override stderr to
115
114
        # avoid distracting noise in the test output.
116
 
        self.overrideAttr(sys, 'stderr', StringIO())
117
 
        self._run_check_error(RuntimeError, ("d0:" * 10000) + 'i1e' + ("e" * 10000))
 
115
        self.overrideAttr(sys, 'stderr', self._log_file)
 
116
        self._run_check_error(
 
117
            RuntimeError, ("d0:" * 10000) + 'i1e' + ("e" * 10000))
118
118
 
119
119
    def test_malformed_dict(self):
120
120
        self._run_check_error(ValueError, 'd')