~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-09 19:25:42 UTC
  • mto: (5777.5.1 inventoryworkingtree)
  • mto: This revision was merged to the branch mainline in revision 5781.
  • Revision ID: jelmer@samba.org-20110409192542-8bbedp36s7nj928e
Split InventoryTree out of Tree.

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
 
23
25
from bzrlib import (
24
26
    config,
25
27
    crash,
101
103
        except AssertionError, e:
102
104
            pass
103
105
        crash.report_bug_legacy(sys.exc_info(), err_file)
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)
 
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))