allow unhandled exceptions to cause test errors

Hiding the unhandled exception in the test with a failure makes it
harder to debug the problem. Let them pass unhandled so the test reports
an ERROR instead of FAILURE.

Change-Id: I4e435a6d276fdf161dac28f08c2c7efedd1d6385
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-06-26 10:57:38 -04:00
parent 392fa4f7c8
commit c8a7a5d56d
1 changed files with 0 additions and 16 deletions

View File

@ -93,8 +93,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' not in e.message:
self.fail('No certificate failure message is received')
except Exception:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v1_requests_cert_verification_no_compression(self, __):
@ -112,8 +110,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' not in e.message:
self.fail('No certificate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_cert_verification(self, __):
@ -130,8 +126,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' not in e.message:
self.fail('No certificate failure message is received')
except Exception:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_cert_verification_no_compression(self, __):
@ -149,8 +143,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' not in e.message:
self.fail('No certificate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_valid_cert_verification(self, __):
@ -168,8 +160,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' in e.message:
self.fail('Certificate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_valid_cert_verification_no_compression(self, __):
@ -187,8 +177,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if 'certificate verify failed' in e.message:
self.fail('Certificate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_valid_cert_no_key(self, __):
@ -208,8 +196,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
except exc.CommunicationError as e:
if ('PEM lib' not in e.message):
self.fail('No appropriate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_bad_cert(self, __):
@ -235,8 +221,6 @@ class TestHTTPSVerifyCert(testtools.TestCase):
'PEM lib' not in e.message or
six.PY3 and 'PEM lib' not in e.message):
self.fail('No appropriate failure message is received')
except Exception as e:
self.fail('Unexpected exception has been raised')
@mock.patch('sys.stderr')
def test_v2_requests_bad_ca(self, __):