diff options
Diffstat (limited to 'Lib/test/test_hash.py')
-rw-r--r-- | Lib/test/test_hash.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py index 385efed..3de3e8d 100644 --- a/Lib/test/test_hash.py +++ b/Lib/test/test_hash.py @@ -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_ |