summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-07-06 22:40:40 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-07-06 21:40:40 -0500
commitb3460c6a9a45a016d1ab65c149c606fa3f07096d (patch)
tree5a1fece24629686327828e96bbcf2c0f7ced778b
parent8a1de8d6cb5656f335b49fa9f4159f82f51e374a (diff)
downloadpyopenssl-b3460c6a9a45a016d1ab65c149c606fa3f07096d.tar.gz
Fixed #657 -- handle OverflowErrors on large allocation requests (#659)
* Fixed #657 -- handle OverflowErrors on large allocation requests * always be overflowing
-rw-r--r--tests/test_rand.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_rand.py b/tests/test_rand.py
index bdd3af0..41a4f27 100644
--- a/tests/test_rand.py
+++ b/tests/test_rand.py
@@ -32,11 +32,11 @@ class TestRand(object):
def test_insufficient_memory(self):
"""
- `OpenSSL.rand.bytes` raises `MemoryError` if more bytes are requested
- than will fit in memory.
+ `OpenSSL.rand.bytes` raises `MemoryError` or `OverflowError` if more
+ bytes are requested than will fit in memory.
"""
- with pytest.raises(MemoryError):
- rand.bytes(sys.maxsize)
+ with pytest.raises((MemoryError, OverflowError)):
+ rand.bytes(sys.maxsize + 1)
def test_bytes(self):
"""