Skip to content

Commit 7a4f172

Browse files
committed
fix: loosen constructor str rejection test for PyPy compatibility
PyPy doesn't support tp_vectorcall, so constructors fall back to tp_init with y* format, which gives a different error message. Use plain assertRaises(TypeError) instead of assertRaisesRegex.
1 parent 53e721d commit 7a4f172

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

tests/test_hashlib_compat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def test_str_rejected(self):
3030
def test_str_rejected_constructor(self):
3131
for algo in ('xxh32', 'xxh64', 'xxh3_64', 'xxh3_128'):
3232
cls = getattr(xxhash, algo)
33-
with self.assertRaisesRegex(TypeError,
34-
'Strings must be encoded before hashing'):
33+
with self.assertRaises(TypeError):
3534
cls('hello')
3635

3736
def test_str_rejected_update(self):

0 commit comments

Comments
 (0)