fix missed oom handling in unset required

PiperOrigin-RevId: 956610684
This commit is contained in:
Protobuf Team Bot 2026-07-30 10:39:35 -07:00 committed by Copybara-Service
parent 706656afeb
commit 2a36520396
5 changed files with 70 additions and 16 deletions

View file

@ -85,10 +85,21 @@ class MessageTest(unittest.TestCase):
_ = msg3.SerializePartialToString()
_ = msg3.ListFields()
_ = msg3.DiscardUnknownFields()
_ = msg3.FindInitializationErrors()
msg4 = message_module.TestAllTypes()
msg4.CopyFrom(msg3)
# Try deepcopy
_ = copy.deepcopy(msg3)
# Try other upb message APIs
_ = msg3.ByteSize()
_ = msg3.SerializePartialToString()
_ = msg3.ListFields()
_ = msg3.FindInitializationErrors()
_ = msg3.DiscardUnknownFields()
if hasattr(message_module, 'TestAllExtensions'):
ext_msg = message_module.TestAllExtensions()
test_util.SetAllExtensions(ext_msg)