Skip to content

Commit a172388

Browse files
committed
bpo-38142: Remove refleak test from test_hashlib
The updated type no longer accepts random arguments to __init__. Signed-off-by: Christian Heimes <[email protected]>
1 parent bce70a2 commit a172388

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

Lib/test/test_hashlib.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,6 @@ def hash_constructors(self):
167167
constructors = self.constructors_to_test.values()
168168
return itertools.chain.from_iterable(constructors)
169169

170-
@support.refcount_test
171-
@unittest.skipIf(c_hashlib is None, 'Require _hashlib module')
172-
def test_refleaks_in_hash___init__(self):
173-
gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')
174-
sha1_hash = c_hashlib.new('sha1')
175-
refs_before = gettotalrefcount()
176-
for i in range(100):
177-
sha1_hash.__init__('sha1')
178-
self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10)
179-
180170
def test_hash_array(self):
181171
a = array.array("b", range(10))
182172
for cons in self.hash_constructors:

Modules/_hashopenssl.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@
3434

3535
#define MUNCH_SIZE INT_MAX
3636

37-
<<<<<<< HEAD
3837
#ifdef NID_sha3_224
39-
=======
40-
<<<<<<< HEAD
41-
#if defined(NID_sha3_224) && defined(EVP_MD_FLAG_XOF)
42-
>>>>>>> bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant
4338
#define PY_OPENSSL_HAS_SHA3 1
4439
#endif
4540

@@ -50,7 +45,7 @@
5045
#ifdef NID_blake2b512
5146
#define PY_OPENSSL_HAS_BLAKE2 1
5247
#endif
53-
=======
48+
5449
static PyModuleDef _hashlibmodule;
5550

5651
typedef struct {
@@ -60,7 +55,6 @@ typedef struct {
6055
#define _hashlibstate(o) ((_hashlibstate *)PyModule_GetState(o))
6156
#define _hashlibstate_global ((_hashlibstate *)PyModule_GetState(PyState_FindModule(&_hashlibmodule)))
6257

63-
>>>>>>> bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant
6458

6559
typedef struct {
6660
PyObject_HEAD

0 commit comments

Comments
 (0)