Fixed tests that were missing enum type wrapper class.

pull/13171/head
Joshua Haberman 3 years ago
parent a2e280e865
commit 4447d87695
  1. 11
      python/message.c
  2. 6
      python/pb_unit_tests/reflection_test_wrapper.py

@ -1636,7 +1636,6 @@ bool PyUpb_InitMessage(PyObject* m) {
if (PyModule_AddObject(m, "MessageMeta", message_meta_type)) return false;
PyObject* mod = PyImport_ImportModule("google.protobuf.message");
if (mod == NULL) return false;
state->encode_error_class = PyObject_GetAttrString(mod, "EncodeError");
@ -1644,8 +1643,16 @@ bool PyUpb_InitMessage(PyObject* m) {
state->message_class = PyObject_GetAttrString(mod, "Message");
Py_DECREF(mod);
PyObject* enum_type_wrapper =
PyImport_ImportModule("google.protobuf.internal.enum_type_wrapper");
if (enum_type_wrapper == NULL) return false;
state->enum_type_wrapper_class =
PyObject_GetAttrString(enum_type_wrapper, "EnumTypeWrapper");
Py_DECREF(enum_type_wrapper);
if (!state->encode_error_class || !state->decode_error_class ||
!state->message_class) {
!state->message_class || !state->enum_type_wrapper_class) {
return false;
}

@ -48,12 +48,6 @@ reflection_test.ReflectionTest.testConstructorTypeError_proto2.__unittest_expect
reflection_test.ReflectionTest.testConstructorTypeError_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testDeepCopy_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testDeepCopy_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_KeysAndValues_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_KeysAndValues_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_Name_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_Name_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_Value_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testEnum_Value_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testIllegalValuesForIntegers_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testIllegalValuesForIntegers_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testRepeatedScalarTypeSafety_proto2.__unittest_expecting_failure__ = True

Loading…
Cancel
Save