From 342221130918f4525f01e31d3697cfc077df090e Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 29 Jan 2018 19:10:12 -0800 Subject: Use pytest asserts Signed-off-by: Joffrey F --- tests/unit/ssladapter_test.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/unit/ssladapter_test.py') diff --git a/tests/unit/ssladapter_test.py b/tests/unit/ssladapter_test.py index 2b7ce52..73b7336 100644 --- a/tests/unit/ssladapter_test.py +++ b/tests/unit/ssladapter_test.py @@ -1,5 +1,6 @@ import unittest from docker.transport import ssladapter +import pytest try: from backports.ssl_match_hostname import ( @@ -69,11 +70,9 @@ class MatchHostnameTest(unittest.TestCase): assert match_hostname(self.cert, 'touhou.gensokyo.jp') is None def test_match_ip_address_failure(self): - self.assertRaises( - CertificateError, match_hostname, self.cert, '192.168.0.25' - ) + with pytest.raises(CertificateError): + match_hostname(self.cert, '192.168.0.25') def test_match_dns_failure(self): - self.assertRaises( - CertificateError, match_hostname, self.cert, 'foobar.co.uk' - ) + with pytest.raises(CertificateError): + match_hostname(self.cert, 'foobar.co.uk') -- cgit v1.2.1