/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_crash.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import doctest
19
19
import os
20
 
from StringIO import StringIO
21
20
import sys
22
21
 
23
 
from breezy import (
 
22
from .. import (
24
23
    config,
25
24
    crash,
26
25
    osutils,
27
26
    plugin,
28
27
    tests,
29
28
    )
30
 
 
31
 
from breezy.tests import features
 
29
from ..sixish import (
 
30
    BytesIO,
 
31
    )
 
32
from . import features
32
33
 
33
34
 
34
35
class TestApportReporting(tests.TestCaseInTempDir):
46
47
            'plugin_warnings',
47
48
            {'example': ['Failed to load plugin foo']})
48
49
 
49
 
        stderr = StringIO()
 
50
        stderr = BytesIO()
50
51
 
51
52
        try:
52
53
            raise AssertionError("my error")
53
 
        except AssertionError, e:
 
54
        except AssertionError as e:
54
55
            pass
55
56
 
56
57
        crash_filename = crash.report_bug_to_apport(sys.exc_info(),
95
96
 
96
97
    def test_report_bug_legacy(self):
97
98
        self.setup_fake_plugins()
98
 
        err_file = StringIO()
 
99
        err_file = BytesIO()
99
100
        try:
100
101
            raise AssertionError("my error")
101
 
        except AssertionError, e:
 
102
        except AssertionError as e:
102
103
            pass
103
104
        crash.report_bug_legacy(sys.exc_info(), err_file)
104
105
        report = err_file.getvalue()