From edd7a0063d25f1a7f34306f9a9488247593888a9 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 20 Apr 2018 15:50:40 -0700 Subject: [PATCH] Address #1365. CertificateError str repr is tuple, not str. Signed-off-by: Jeremy Cline --- test/test_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_connection.py b/test/test_connection.py index be50f6c..dfc757d 100644 --- a/test/test_connection.py +++ b/test/test_connection.py @@ -38,7 +38,7 @@ class TestConnection(object): with mock.patch('urllib3.connection.log.error') as mock_log: _match_hostname(cert, asserted_hostname) except CertificateError as e: - assert str(e) == "hostname 'bar' doesn't match 'foo'" + assert "hostname 'bar' doesn't match 'foo'" in str(e) mock_log.assert_called_once_with( 'Certificate did not match expected hostname: %s. ' 'Certificate: %s', -- 2.17.0