~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Martin Pool
  • Date: 2006-06-04 22:13:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mbp@sourcefrog.net-20060604221303-1f902e4ec57868d4
Show short form for OSError and IOError too

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    def test_format_interrupt_exception(self):
53
53
        try:
54
54
            raise KeyboardInterrupt()
55
 
        except KeyboardInterrupt():
 
55
        except KeyboardInterrupt:
56
56
            # XXX: Some risk that a *real* keyboard interrupt won't be seen
57
57
            pass
58
58
        msg = _format_exception()
59
59
        self.assertTrue(len(msg) > 0)
60
60
        self.assertEqualDiff(msg, 'bzr: interrupted\n')
61
61
 
 
62
    def test_format_os_error(self):
 
63
        try:
 
64
            file('nosuchfile22222')
 
65
        except (OSError, IOError):
 
66
            pass
 
67
        msg = _format_exception()
 
68
        self.assertContainsRe(msg, r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
 
69
 
 
70
 
62
71
    def test_format_exception(self):
63
72
        """Short formatting of bzr exceptions"""
64
73
        try: