~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_crash.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-18 23:21:01 UTC
  • mfrom: (5799 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110418232101-utgj6599ow9ny9nh
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from StringIO import StringIO
21
21
import sys
22
22
 
23
 
from testtools.matchers import DocTestMatches
24
 
 
25
23
from bzrlib import (
26
24
    config,
27
25
    crash,
103
101
        except AssertionError, e:
104
102
            pass
105
103
        crash.report_bug_legacy(sys.exc_info(), err_file)
106
 
        self.assertThat(
107
 
            err_file.getvalue(),
108
 
            DocTestMatches("""\
109
 
bzr: ERROR: exceptions.AssertionError: my error
110
 
 
111
 
Traceback (most recent call last):
112
 
  ...
113
 
AssertionError: my error
114
 
 
115
 
bzr ... on python ...
116
 
arguments: ...
117
 
plugins: fake_plugin[1.2.3]
118
 
encoding: ...
119
 
 
120
 
*** Bazaar has encountered an internal error.  This probably indicates a
121
 
    bug in Bazaar.  You can help us fix it by filing a bug report at
122
 
        https://bugs.launchpad.net/bzr/+filebug
123
 
    including this traceback and a description of the problem.
124
 
""", flags=doctest.ELLIPSIS|doctest.REPORT_UDIFF))
 
104
        report = err_file.getvalue()
 
105
        for needle in [
 
106
            "bzr: ERROR: exceptions.AssertionError: my error",
 
107
            r"Traceback \(most recent call last\):",
 
108
            r"plugins: fake_plugin\[1\.2\.3\]",
 
109
            ]:
 
110
            self.assertContainsRe(
 
111
                    report,
 
112
                    needle)