mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #18339: use with self.assertRaises() to make test case more readable
This commit is contained in:
commit
3126a3d156
1 changed files with 4 additions and 2 deletions
|
@ -117,9 +117,11 @@ if has_c_implementation:
|
|||
|
||||
def test_issue18339(self):
|
||||
unpickler = self.unpickler_class(io.BytesIO())
|
||||
self.assertRaises(TypeError, setattr, unpickler, "memo", object)
|
||||
with self.assertRaises(TypeError):
|
||||
unpickler.memo = object
|
||||
# used to cause a segfault
|
||||
self.assertRaises(ValueError, setattr, unpickler, "memo", {-1: None})
|
||||
with self.assertRaises(ValueError):
|
||||
unpickler.memo = {-1: None}
|
||||
unpickler.memo = {1: None}
|
||||
|
||||
class CDispatchTableTests(AbstractDispatchTableTests):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue