Kaydet (Commit) 21782488 authored tarafından Christian Heimes's avatar Christian Heimes

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

üst cca8c53d
......@@ -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