Commit 3126a3d1 authored by Christian Heimes's avatar Christian Heimes

Issue #18339: use with self.assertRaises() to make test case more readable

parents 626032ac 21782488
......@@ -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):
......
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