diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 15:38:39 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-05-20 15:38:39 (GMT) |
commit | 3ddcfb119dc8890756d303a1419c15e3f1f76d8f (patch) | |
tree | 2ecd82eb6a6d7c135b00224df6136a68407427f5 /Lib/test/test_slice.py | |
parent | 35ac5f82804829eec51d5553f080c5697453b5bb (diff) | |
parent | c0e0022f079348f74ad6ecfc40ff8264c0cede74 (diff) | |
download | cpython-3ddcfb119dc8890756d303a1419c15e3f1f76d8f.zip cpython-3ddcfb119dc8890756d303a1419c15e3f1f76d8f.tar.gz cpython-3ddcfb119dc8890756d303a1419c15e3f1f76d8f.tar.bz2 |
Issue #24134: Use assertRaises() in context manager form in test_slice to
avoid passing the test accidently because slice.__hash__ is None.
Diffstat (limited to 'Lib/test/test_slice.py')
-rw-r--r-- | Lib/test/test_slice.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py index d885776..8c4e670 100644 --- 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__) + with self.assertRaises(TypeError): + slice(5).__hash__() def test_cmp(self): s1 = slice(1, 2, 3) |