(original) (raw)

changeset: 96174:36c4f8af99da parent: 96171:435bc22f39e3 parent: 96173:3a1ee0b5a096 user: Serhiy Storchaka storchaka@gmail.com date: Wed May 20 18:38:39 2015 +0300 files: Lib/test/test_slice.py description: Issue #24134: Use assertRaises() in context manager form in test_slice to avoid passing the test accidently because slice.__hash__ is None. diff -r 435bc22f39e3 -r 36c4f8af99da Lib/test/test_slice.py --- a/Lib/test/test_slice.py Wed May 20 18:29:18 2015 +0300 +++ b/Lib/test/test_slice.py Wed May 20 18:38:39 2015 +0300 @@ -79,7 +79,8 @@ def test_hash(self): # Verify clearing of SF bug #800796 self.assertRaises(TypeError, hash, slice(5)) - self.assertRaises(TypeError, slice(5).__hash__) + with self.assertRaises(TypeError): + slice(5).__hash__() def test_cmp(self): s1 = slice(1, 2, 3) /storchaka@gmail.com