mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add a test that memoryviews have hash randomization enabled.
This commit is contained in:
parent
528b54b263
commit
07c65884c6
1 changed files with 6 additions and 0 deletions
|
@ -186,6 +186,12 @@ class BytesHashRandomizationTests(StringlikeHashRandomizationTests):
|
|||
def test_empty_string(self):
|
||||
self.assertEqual(hash(b""), 0)
|
||||
|
||||
class MemoryviewHashRandomizationTests(StringlikeHashRandomizationTests):
|
||||
repr_ = "memoryview(b'abc')"
|
||||
|
||||
def test_empty_string(self):
|
||||
self.assertEqual(hash(memoryview(b"")), 0)
|
||||
|
||||
class DatetimeTests(HashRandomizationTests):
|
||||
def get_hash_command(self, repr_):
|
||||
return 'import datetime; print(hash(%s))' % repr_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue