~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

(mbp) test that socket.error doesn't give a traceback (Toon Nolten)

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        #                with errno, function name, and locale error message
129
129
        self.assertContainsRe(msg,
130
130
            r"^bzr: ERROR: \(2, 'RemoveDirectory[AW]?', .*\)")
 
131
            
 
132
    def test_format_sockets_error(self):
 
133
        try:
 
134
            import socket
 
135
            sock = socket.socket()
 
136
            sock.send("This should fail.")
 
137
        except socket.error:
 
138
            pass
 
139
        msg = _format_exception()
 
140
        
 
141
        self.assertNotContainsRe(msg,
 
142
            r"Traceback (most recent call last):")
131
143
 
132
144
    def test_format_unicode_error(self):
133
145
        try: