cpython: 36c4f8af99da (original) (raw)
Mercurial > cpython
changeset 96174:36c4f8af99da
Issue #24134: Use assertRaises() in context manager form in test_slice to avoid passing the test accidently because slice.__hash__ is None. [#24134]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Wed, 20 May 2015 18:38:39 +0300 |
parents | 435bc22f39e3(current diff)3a1ee0b5a096(diff) |
children | b9f436efe48c |
files | Lib/test/test_slice.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_slice.py 3 |
line wrap: on
line diff
--- a/Lib/test/test_slice.py +++ b/Lib/test/test_slice.py @@ -79,7 +79,8 @@ class SliceTest(unittest.TestCase): def test_hash(self): # Verify clearing of SF bug #800796 self.assertRaises(TypeError, hash, slice(5))
self.assertRaises(TypeError, slice(5).__hash__)[](#l1.7)
with self.assertRaises(TypeError):[](#l1.8)
slice(5).__hash__()[](#l1.9)