bpo-31787: Skip refleak check when _hashlib is not available (GH-5660) · python/cpython@f0bc645

Original file line numberDiff line numberDiff line change

@@ -163,6 +163,7 @@ def hash_constructors(self):

163163

return itertools.chain.from_iterable(constructors)

164164
165165

@support.refcount_test

166+

@unittest.skipIf(c_hashlib is None, 'Require _hashlib module')

166167

def test_refleaks_in_hash___init__(self):

167168

gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')

168169

sha1_hash = c_hashlib.new('sha1')