Commit c0e0022f authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24134: Use assertRaises() in context manager form in test_slice to

avoid passing the test accidently because slice.__hash__ is None.
parent ef94869f
...@@ -80,7 +80,8 @@ class SliceTest(unittest.TestCase): ...@@ -80,7 +80,8 @@ class SliceTest(unittest.TestCase):
def test_hash(self): def test_hash(self):
# Verify clearing of SF bug #800796 # Verify clearing of SF bug #800796
self.assertRaises(TypeError, hash, slice(5)) self.assertRaises(TypeError, hash, slice(5))
self.assertRaises(TypeError, slice(5).__hash__) with self.assertRaises(TypeError):
slice(5).__hash__()
def test_cmp(self): def test_cmp(self):
s1 = slice(1, 2, 3) s1 = slice(1, 2, 3)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment