Commit a47a676b authored by Jason Madden's avatar Jason Madden

pypy 'incorrectly' raises a plain ssl.SSLError where CPython would raise a...

pypy 'incorrectly' raises a plain ssl.SSLError where CPython would raise a ssl.SSLEOFError, even though pypy defines that class. But pypy doesn't try too hard to match exact exceptions with cpython.
parent c0fa367b
...@@ -57,14 +57,16 @@ class TestSSL(test__socket.TestTCP): ...@@ -57,14 +57,16 @@ class TestSSL(test__socket.TestTCP):
server_sock[0][0].close() server_sock[0][0].close()
def test_empty_send(self): def test_empty_send(self):
# Sending empty bytes with the 'send' method # Issue 719
# raises ssl.SSLEOFError in the stdlib. (just ssl.SSLError on # Sending empty bytes with the 'send' method raises
# py26). Issue 719 # ssl.SSLEOFError in the stdlib. PyPy 4.0 and CPython 2.6
expected = getattr(ssl, 'SSLEOFError', ssl.SSLError) # both just raise the superclass, ssl.SSLError.
expected = ssl.SSLError
self.assertRaises(expected, self._test_sendall, self.assertRaises(expected, self._test_sendall,
b'', b'',
client_method='send') client_method='send')
def ssl_listener(address, private_key, certificate): def ssl_listener(address, private_key, certificate):
raw_listener = socket.socket() raw_listener = socket.socket()
greentest.bind_and_listen(raw_listener, address) greentest.bind_and_listen(raw_listener, address)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment