summaryrefslogtreecommitdiff
path: root/OpenSSL
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-09-05 13:35:18 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-09-05 13:35:18 -0400
commit1aabb2ebd3f2adfa8a227b8af02630e92e7f7568 (patch)
treec73d51da41e096e2b602b7f874acbbb0771cf328 /OpenSSL
parentd0e83ad1f3cb3397a4bcc2bac0711171dccdd596 (diff)
downloadpyopenssl-1aabb2ebd3f2adfa8a227b8af02630e92e7f7568.tar.gz
attempted simple fix
Diffstat (limited to 'OpenSSL')
-rw-r--r--OpenSSL/test/test_ssl.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index 4d41b15..d54c839 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -15,6 +15,8 @@ from unittest import main
from weakref import ref
from warnings import catch_warnings, simplefilter
+import pytest
+
from six import PY3, text_type, u
from OpenSSL.crypto import TYPE_RSA, FILETYPE_PEM
@@ -2198,10 +2200,10 @@ class ConnectionTests(TestCase, _LoopbackMixin):
:py:obj:`Connection.connect` raises :py:obj:`TypeError` if called with a non-address
argument or with the wrong number of arguments.
"""
-
+
def attr_access_test(connection):
return connection.an_attribute_which_is_not_defined
-
+
connection = Connection(Context(TLSv1_METHOD), None)
self.assertRaises(AttributeError, attr_access_test, connection)
@@ -2213,9 +2215,9 @@ class ConnectionTests(TestCase, _LoopbackMixin):
client = socket()
context = Context(TLSv1_METHOD)
clientSSL = Connection(context, client)
- exc = self.assertRaises(error, clientSSL.connect, ("127.0.0.1", 1))
- self.assertEquals(exc.args[0], ECONNREFUSED)
-
+ with pytest.raises(error) as exc:
+ clientSSL.connect(("127.0.0.1", 1))
+ assert exc.value.args[0] == ECONNREFUSED
def test_connect(self):
"""