mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant (#16071)
* Updated _hashopenssl.c to be PEP 384 compliant * Remove refleak test from test_hashlib. The updated type no longer accepts random arguments to __init__.
This commit is contained in:
parent
cc28ed2421
commit
df69e75edc
3 changed files with 69 additions and 64 deletions
|
|
@ -167,16 +167,6 @@ class HashLibTestCase(unittest.TestCase):
|
|||
constructors = self.constructors_to_test.values()
|
||||
return itertools.chain.from_iterable(constructors)
|
||||
|
||||
@support.refcount_test
|
||||
@unittest.skipIf(c_hashlib is None, 'Require _hashlib module')
|
||||
def test_refleaks_in_hash___init__(self):
|
||||
gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')
|
||||
sha1_hash = c_hashlib.new('sha1')
|
||||
refs_before = gettotalrefcount()
|
||||
for i in range(100):
|
||||
sha1_hash.__init__('sha1')
|
||||
self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10)
|
||||
|
||||
def test_hash_array(self):
|
||||
a = array.array("b", range(10))
|
||||
for cons in self.hash_constructors:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue