Merge branch 'python-tests' into python-repeated

pull/13171/head
Joshua Haberman 3 years ago
commit 575522c23a
  1. 2
      .github/workflows/bazel_tests.yml
  2. 2
      WORKSPACE
  3. 47
      bazel/protobuf.patch
  4. 6
      bazel/workspace_defs.bzl
  5. 15
      bazel/workspace_deps.bzl
  6. 3
      cmake/make_cmakelists.py
  7. 52
      python/BUILD
  8. 50
      python/api_implementation.c
  9. 5
      python/descriptor.c
  10. 5
      python/descriptor_containers.c
  11. 72
      python/message.c
  12. 7
      python/minimal_test.py
  13. 245
      python/pb_unit_tests/BUILD
  14. 11
      python/pb_unit_tests/README.md
  15. 33
      python/pb_unit_tests/descriptor_database_test_wrapper.py
  16. 73
      python/pb_unit_tests/descriptor_pool_test_wrapper.py
  17. 85
      python/pb_unit_tests/descriptor_test_wrapper.py
  18. 40
      python/pb_unit_tests/generator_test_wrapper.py
  19. 72
      python/pb_unit_tests/json_format_test_wrapper.py
  20. 35
      python/pb_unit_tests/keywords_test_wrapper.py
  21. 41
      python/pb_unit_tests/message_factory_test_wrapper.py
  22. 135
      python/pb_unit_tests/message_test_wrapper.py
  23. 35
      python/pb_unit_tests/proto_builder_test_wrapper.py
  24. 150
      python/pb_unit_tests/reflection_test_wrapper.py
  25. 30
      python/pb_unit_tests/service_reflection_test_wrapper.py
  26. 39
      python/pb_unit_tests/symbol_database_test_wrapper.py
  27. 30
      python/pb_unit_tests/text_encoding_test_wrapper.py
  28. 202
      python/pb_unit_tests/text_format_test_wrapper.py
  29. 58
      python/pb_unit_tests/unknown_fields_test_wrapper.py
  30. 44
      python/pb_unit_tests/well_known_types_test_wrapper.py
  31. 30
      python/pb_unit_tests/wire_format_test_wrapper.py
  32. 25
      python/repeated.c
  33. 3
      upb/decode_fast.c

@ -22,7 +22,7 @@ jobs:
- { CC: clang, os: ubuntu-20.04, flags: "-c opt" } # Some warnings only fire with -c opt - { CC: clang, os: ubuntu-20.04, flags: "-c opt" } # Some warnings only fire with -c opt
- { CC: gcc, os: ubuntu-20.04, flags: "-c opt" } - { CC: gcc, os: ubuntu-20.04, flags: "-c opt" }
- { CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" } - { CC: clang, os: ubuntu-20.04, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" }
- { CC: clang, os: ubuntu-20.04, flags: "--config=asan -- -benchmarks:benchmark -python:all" } - { CC: clang, os: ubuntu-20.04, flags: "--config=asan -- -benchmarks:benchmark -python/..." }
- { CC: clang, os: macos-11, flags: "" } - { CC: clang, os: macos-11, flags: "" }
steps: steps:

@ -43,6 +43,8 @@ system_python(
name = "system_python" name = "system_python"
) )
register_toolchains("@system_python//:python_toolchain")
http_archive( http_archive(
name = "rules_fuzzing", name = "rules_fuzzing",
sha256 = "e1b54211f7cee604194db080a8765220d3ef5db2a873fded429ce13e74d93a6b", sha256 = "e1b54211f7cee604194db080a8765220d3ef5db2a873fded429ce13e74d93a6b",

@ -0,0 +1,47 @@
--- BUILD
+++ BUILD
@@ -931,13 +931,10 @@ py_library(
[
"python/google/protobuf/**/*.py",
],
- exclude = [
- "python/google/protobuf/internal/*_test.py",
- "python/google/protobuf/internal/test_util.py",
- ],
),
imports = ["python"],
srcs_version = "PY2AND3",
+ visibility = ["//visibility:public"],
)
cc_binary(
@@ -1038,13 +1035,6 @@ py_proto_library(
name = "protobuf_python",
srcs = COPIED_WELL_KNOWN_PROTOS,
include = "python",
- data = select({
- "//conditions:default": [],
- ":use_fast_cpp_protos": [
- ":python/google/protobuf/internal/_api_implementation.so",
- ":python/google/protobuf/pyext/_message.so",
- ],
- }),
default_runtime = "",
protoc = ":protoc",
py_libs = [
@@ -1080,6 +1070,7 @@ py_proto_library(
protoc = ":protoc",
srcs_version = "PY2AND3",
deps = [":protobuf_python"],
+ visibility = ["//visibility:public"],
)
py_proto_library(
@@ -1093,6 +1084,7 @@ py_proto_library(
protoc = ":protoc",
srcs_version = "PY2AND3",
deps = [":python_common_test_protos"],
+ visibility = ["//visibility:public"],
)
py_library(

@ -52,10 +52,6 @@ toolchain(
) )
""" """
_build_defs_file = """
EXT_SUFFIX = "%s"
"""
def _get_config_var(repository_ctx, name): def _get_config_var(repository_ctx, name):
py_program = "import sysconfig; print(sysconfig.get_config_var('%s'), end='')" py_program = "import sysconfig; print(sysconfig.get_config_var('%s'), end='')"
result = repository_ctx.execute(["python3", "-c", py_program % (name)]) result = repository_ctx.execute(["python3", "-c", py_program % (name)])
@ -65,11 +61,9 @@ def _get_config_var(repository_ctx, name):
def _python_headers_impl(repository_ctx): def _python_headers_impl(repository_ctx):
path = _get_config_var(repository_ctx, "INCLUDEPY") path = _get_config_var(repository_ctx, "INCLUDEPY")
ext_suffix = _get_config_var(repository_ctx, "EXT_SUFFIX")
repository_ctx.symlink(path, "python") repository_ctx.symlink(path, "python")
python3 = repository_ctx.which("python3") python3 = repository_ctx.which("python3")
repository_ctx.file("BUILD.bazel", _build_file % python3) repository_ctx.file("BUILD.bazel", _build_file % python3)
repository_ctx.file("build_defs.bzl", _build_defs_file % ext_suffix)
# The system_python() repository rule exposes Python headers from the system. # The system_python() repository rule exposes Python headers from the system.
# #

@ -13,11 +13,20 @@ def upb_deps():
maybe( maybe(
http_archive, http_archive,
name = "com_google_protobuf", name = "com_google_protobuf",
sha256 = "b10bf4e2d1a7586f54e64a5d9e7837e5188fc75ae69e36f215eb01def4f9721b", sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
strip_prefix = "protobuf-3.15.3", strip_prefix = "protobuf-3.19.1",
urls = [ urls = [
"https://github.com/protocolbuffers/protobuf/archive/v3.15.3.tar.gz", "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz",
], ],
patches = [
"//bazel:protobuf.patch",
],
patch_cmds = [
"rm python/google/protobuf/__init__.py",
"rm python/google/protobuf/pyext/__init__.py",
"rm python/google/protobuf/internal/__init__.py",
]
) )
maybe( maybe(

@ -223,6 +223,9 @@ class WorkspaceFileFunctions(object):
def system_python(self, **kwargs): def system_python(self, **kwargs):
pass pass
def register_toolchains(self, toolchain):
pass
class Converter(object): class Converter(object):
def __init__(self): def __init__(self):

@ -27,10 +27,6 @@ load(
"//bazel:build_defs.bzl", "//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS", "UPB_DEFAULT_COPTS",
) )
load(
"@system_python//:build_defs.bzl",
"EXT_SUFFIX",
)
cc_binary( cc_binary(
name = "message", name = "message",
@ -76,18 +72,58 @@ cc_binary(
], ],
) )
# Copy the extension into the location recognized by Python. cc_binary(
name = "api_implementation",
srcs = [
"api_implementation.c",
],
# Enable once linker script is available.
#copts = ["-fvisibility=hidden"],
deps = ["@system_python//:python_headers"],
linkshared = True,
linkstatic = True,
)
# Copy the extensions into the location recognized by Python.
# .abi3.so indicates use of the limited API, and cross-version ABI compatibility.
EXT_SUFFIX = ".abi3.so"
genrule( genrule(
name = "message_ext", name = "copy_message",
srcs = [":message"], srcs = [":message"],
outs = ["google/protobuf/pyext/_message" + EXT_SUFFIX], outs = ["google/protobuf/pyext/_message" + EXT_SUFFIX],
cmd = "cp $< $@", cmd = "cp $< $@",
) )
genrule(
name = "copy_api_implementation",
srcs = [":api_implementation"],
outs = ["google/protobuf/internal/_api_implementation" + EXT_SUFFIX],
cmd = "cp $< $@",
visibility = ["//python:__subpackages__"],
)
py_library(
name = "message_ext",
data = [
"google/protobuf/pyext/_message" + EXT_SUFFIX,
"google/protobuf/internal/_api_implementation" + EXT_SUFFIX,
],
imports = ["."],
visibility = ["//python:__subpackages__"],
)
py_test( py_test(
name = "minimal_test", name = "minimal_test",
srcs = ["minimal_test.py"], srcs = [
data = [":message_ext"], "minimal_test.py",
],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
imports = ["."], imports = ["."],
legacy_create_init = False, legacy_create_init = False,
) )

@ -0,0 +1,50 @@
/*
* Copyright (c) 2009-2021, Google LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Google LLC nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <Python.h>
static struct PyModuleDef module_def = {
PyModuleDef_HEAD_INIT,
"google.protobuf.internal._api_implementation",
"Protobuf Module",
-1,
NULL,
NULL,
NULL,
NULL,
NULL};
PyMODINIT_FUNC PyInit__api_implementation(void) {
PyObject* module = PyModule_Create(&module_def);
if (PyModule_AddIntConstant(module, "api_version", 2)) {
Py_DECREF(module);
return NULL;
}
return module;
}

@ -190,6 +190,7 @@ static void PyUpb_DescriptorBase_Dealloc(PyUpb_DescriptorBase* base) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
PyObject* PyUpb_Descriptor_Get(const upb_msgdef* m) { PyObject* PyUpb_Descriptor_Get(const upb_msgdef* m) {
assert(m);
const upb_filedef* file = upb_msgdef_file(m); const upb_filedef* file = upb_msgdef_file(m);
return PyUpb_DescriptorBase_Get(kPyUpb_Descriptor, m, file); return PyUpb_DescriptorBase_Get(kPyUpb_Descriptor, m, file);
} }
@ -647,7 +648,9 @@ static PyObject* PyUpb_EnumDescriptor_GetValuesByNumber(PyObject* _self,
static PyObject* PyUpb_EnumDescriptor_GetContainingType(PyObject* _self, static PyObject* PyUpb_EnumDescriptor_GetContainingType(PyObject* _self,
void* closure) { void* closure) {
PyUpb_DescriptorBase* self = (void*)_self; PyUpb_DescriptorBase* self = (void*)_self;
return PyUpb_Descriptor_Get(upb_enumdef_containingtype(self->def)); const upb_msgdef* m = upb_enumdef_containingtype(self->def);
if (!m) Py_RETURN_NONE;
return PyUpb_Descriptor_Get(m);
} }
static PyObject* PyUpb_EnumDescriptor_GetHasOptions(PyObject* _self, static PyObject* PyUpb_EnumDescriptor_GetHasOptions(PyObject* _self,

@ -167,14 +167,12 @@ static int PyUpb_GenericSequence_IsEqual(PyUpb_GenericSequence *self,
} }
PyObject *item1; PyObject *item1;
PyObject *item2;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
item1 = PyUpb_GenericSequence_GetItem((PyObject*)self, i); item1 = PyUpb_GenericSequence_GetItem((PyObject*)self, i);
item2 = PyList_GetItem(other, i); PyObject* item2 = PyList_GetItem(other, i);
if (!item1 || !item2) goto error; if (!item1 || !item2) goto error;
int cmp = PyObject_RichCompareBool(item1, item2, Py_EQ); int cmp = PyObject_RichCompareBool(item1, item2, Py_EQ);
Py_DECREF(item1); Py_DECREF(item1);
Py_DECREF(item2);
if (cmp != 1) return cmp; if (cmp != 1) return cmp;
} }
// All items were found and equal // All items were found and equal
@ -182,7 +180,6 @@ static int PyUpb_GenericSequence_IsEqual(PyUpb_GenericSequence *self,
error: error:
Py_XDECREF(item1); Py_XDECREF(item1);
Py_XDECREF(item2);
return -1; return -1;
} }

@ -327,10 +327,13 @@ void PyUpb_CMessage_AssureWritable(PyUpb_CMessage* self);
static bool PyUpb_CMessage_InitMapAttribute(PyObject* _self, PyObject* name, static bool PyUpb_CMessage_InitMapAttribute(PyObject* _self, PyObject* name,
const upb_fielddef* f, const upb_fielddef* f,
PyObject* value) { PyObject* value) {
PyObject* map = PyUpb_CMessage_GetAttr(_self, name); // TODO(haberman): disabled until map container is in.
int ok = PyUpb_CMessage_InitMapAttributes(map, value, f); // PyObject* map = PyUpb_CMessage_GetAttr(_self, name);
Py_DECREF(map); // int ok = PyUpb_CMessage_InitMapAttributes(map, value, f);
return ok >= 0; // Py_DECREF(map);
// return ok >= 0;
PyErr_SetString(PyExc_NotImplementedError, "map init");
return false;
} }
static bool PyUpb_CMessage_InitRepeatedAttribute(PyObject* _self, static bool PyUpb_CMessage_InitRepeatedAttribute(PyObject* _self,
@ -904,23 +907,37 @@ static PyObject* PyUpb_CMessage_HasField(PyObject* _self, PyObject* arg) {
static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) { static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) {
PyObject* list = PyList_New(0); PyObject* list = PyList_New(0);
upb_msg* msg = PyUpb_CMessage_GetIfWritable(_self); upb_msg* msg = PyUpb_CMessage_GetIfWritable(_self);
if (!msg) return list;
if (msg) { size_t iter1 = UPB_MSG_BEGIN;
size_t iter1 = UPB_MSG_BEGIN; const upb_msgdef* m = PyUpb_CMessage_GetMsgdef(_self);
const upb_msgdef* m = PyUpb_CMessage_GetMsgdef(_self); const upb_symtab* symtab = upb_filedef_symtab(upb_msgdef_file(m));
const upb_symtab* symtab = upb_filedef_symtab(upb_msgdef_file(m)); const upb_fielddef* f;
const upb_fielddef* f; PyObject* field_desc = NULL;
upb_msgval val; PyObject* py_val = NULL;
while (upb_msg_next(msg, m, symtab, &f, &val, &iter1)) { PyObject* tuple = NULL;
PyObject* field_desc = PyUpb_FieldDescriptor_Get(f); upb_msgval val;
PyObject* py_val = PyUpb_CMessage_GetFieldValue(_self, f); while (upb_msg_next(msg, m, symtab, &f, &val, &iter1)) {
PyObject* tuple = Py_BuildValue("(NN)", field_desc, py_val); PyObject* field_desc = PyUpb_FieldDescriptor_Get(f);
PyList_Append(list, tuple); PyObject* py_val = PyUpb_CMessage_GetFieldValue(_self, f);
Py_DECREF(tuple); if (!field_desc || !py_val) goto err;
} PyObject* tuple = Py_BuildValue("(NN)", field_desc, py_val);
field_desc = NULL;
py_val = NULL;
if (!tuple) goto err;
if (!PyList_Append(list, tuple)) goto err;
Py_DECREF(tuple);
tuple = NULL;
} }
return list; return list;
err:
Py_XDECREF(field_desc);
Py_XDECREF(py_val);
Py_XDECREF(tuple);
Py_DECREF(list);
return NULL;
} }
PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg) { PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg) {
@ -1433,8 +1450,9 @@ static PyObject* PyUpb_MessageMeta_New(PyTypeObject* type, PyObject* args,
Py_ssize_t size = PyTuple_Size(bases); Py_ssize_t size = PyTuple_Size(bases);
if (!(size == 0 || if (!(size == 0 ||
(size == 1 && PyTuple_GetItem(bases, 0) == state->message_class))) { (size == 1 && PyTuple_GetItem(bases, 0) == state->message_class))) {
PyErr_SetString(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"A Message class can only inherit from Message"); "A Message class can only inherit from Message, not %S",
bases);
return NULL; return NULL;
} }
@ -1532,7 +1550,7 @@ static PyType_Spec PyUpb_MessageMeta_Spec = {
PyUpb_MessageMeta_Slots, PyUpb_MessageMeta_Slots,
}; };
static PyObject* PyUpb_MessageMeta_CreateType() { static PyObject* PyUpb_MessageMeta_CreateType(void) {
PyObject* bases = Py_BuildValue("(O)", &PyType_Type); PyObject* bases = Py_BuildValue("(O)", &PyType_Type);
if (!bases) return NULL; if (!bases) return NULL;
PyUpb_MessageMeta_Spec.basicsize = PyUpb_MessageMeta_Spec.basicsize =
@ -1553,5 +1571,19 @@ bool PyUpb_InitMessage(PyObject* m) {
if (!state->cmessage_type || !state->message_meta_type) return false; if (!state->cmessage_type || !state->message_meta_type) return false;
if (PyModule_AddObject(m, "MessageMeta", message_meta_type)) return false; 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");
state->decode_error_class = PyObject_GetAttrString(mod, "DecodeError");
state->message_class = PyObject_GetAttrString(mod, "Message");
Py_DECREF(mod);
if (!state->encode_error_class || !state->decode_error_class ||
!state->message_class) {
return false;
}
return true; return true;
} }

@ -29,6 +29,7 @@
import unittest import unittest
from google.protobuf.pyext import _message from google.protobuf.pyext import _message
from google.protobuf.internal import api_implementation
class TestMessageExtension(unittest.TestCase): class TestMessageExtension(unittest.TestCase):
@ -48,8 +49,12 @@ class TestMessageExtension(unittest.TestCase):
def test_lib_is_upb(self): def test_lib_is_upb(self):
# Ensure we are not pulling in a different protobuf library on the # Ensure we are not pulling in a different protobuf library on the
# system. # system.
print(_message._IS_UPB)
self.assertTrue(_message._IS_UPB) self.assertTrue(_message._IS_UPB)
self.assertEqual(api_implementation.Type(), "cpp")
#TestMessageExtension.test_descriptor_pool.__unittest_expecting_failure__ = True
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main(verbosity=2)

@ -0,0 +1,245 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
py_test(
name = "descriptor_database_test",
main = "descriptor_database_test_wrapper.py",
srcs = ["descriptor_database_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "descriptor_pool_test",
main = "descriptor_pool_test_wrapper.py",
srcs = ["descriptor_pool_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "descriptor_test",
main = "descriptor_test_wrapper.py",
srcs = ["descriptor_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "generator_test",
main = "generator_test_wrapper.py",
srcs = ["generator_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "json_format_test",
main = "json_format_test_wrapper.py",
srcs = ["json_format_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "keywords_test",
main = "keywords_test_wrapper.py",
srcs = ["keywords_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "message_factory_test",
main = "message_factory_test_wrapper.py",
srcs = ["message_factory_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "message_test",
main = "message_test_wrapper.py",
srcs = ["message_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "proto_builder_test",
main = "proto_builder_test_wrapper.py",
srcs = ["proto_builder_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "reflection_test",
main = "reflection_test_wrapper.py",
srcs = ["reflection_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "service_reflection_test",
main = "service_reflection_test_wrapper.py",
srcs = ["service_reflection_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "symbol_database_test",
main = "symbol_database_test_wrapper.py",
srcs = ["symbol_database_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "text_encoding_test",
main = "text_encoding_test_wrapper.py",
srcs = ["text_encoding_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "text_format_test",
main = "text_format_test_wrapper.py",
srcs = ["text_format_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "unknown_fields_test",
main = "unknown_fields_test_wrapper.py",
srcs = ["unknown_fields_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "well_known_types_test",
main = "well_known_types_test_wrapper.py",
srcs = ["well_known_types_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)
py_test(
name = "wire_format_test",
main = "wire_format_test_wrapper.py",
srcs = ["wire_format_test_wrapper.py"],
deps = [
"//python:message_ext",
"@com_google_protobuf//:python_srcs",
"@com_google_protobuf//:python_common_test_protos",
"@com_google_protobuf//:python_specific_test_protos",
],
legacy_create_init = False,
)

@ -0,0 +1,11 @@
# Protobuf Unit Tests
This directory contains wrappers around the Python unit tests defined in
the protobuf repo. Python+upb is intended to be a drop-in replacement for
protobuf Python, so we should be able to pass the same set of unit tests.
Our wrappers contain exclusion lists for tests we know we are not currently
passing. Ideally these exclusion lists will become empty once Python+upb is
fully implemented. However there may be a few edge cases that we decide
are not worth matching with perfect parity.

@ -0,0 +1,33 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import descriptor_database_test
import unittest
descriptor_database_test.DescriptorDatabaseTest.testAdd.__unittest_expecting_failure__ = True
descriptor_database_test.DescriptorDatabaseTest.testConflictRegister.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=descriptor_database_test, verbosity=2)

@ -0,0 +1,73 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import descriptor_pool_test
import unittest
print(unittest)
descriptor_pool_test.AddDescriptorTest.testAddTypeError.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testCustomDescriptorPool.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testEmptyDescriptorPool.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testEnum.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testFile.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testFileDescriptorOptionsWithCustomDescriptorPool.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testMessage.__unittest_expecting_failure__ = True
descriptor_pool_test.AddDescriptorTest.testService.__unittest_expecting_failure__ = True
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# AttributeError: 'google.protobuf.pyext._message.FileDescriptor' object has no attribute 'serialized_pb'
#
# TODO: change to __unittest_expecting_failure__ when serialized_pb is available.
descriptor_pool_test.CreateDescriptorPoolTest.testAddSerializedFile.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testComplexNesting.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testConflictRegister.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testDefaultValueForCustomMessages.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testEnumDefaultValue.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testExtensionsAreNotFields.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindAllExtensions.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindEnumTypeByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindEnumTypeByNameFailure.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindExtensionByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindExtensionByNumber.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindFieldByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindFileByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindFileByNameFailure.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindFileContainingSymbol.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindFileContainingSymbolFailure.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindMessageTypeByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindMessageTypeByNameFailure.__unittest_skip__ = True
descriptor_pool_test.DefaultDescriptorPoolTest.testFindMethods.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindOneofByName.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindService.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testFindTypeErrors.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testUserDefinedDB.__unittest_skip__ = True
descriptor_pool_test.CreateDescriptorPoolTest.testAddFileDescriptor.__unittest_skip__ = True
descriptor_pool_test.SecondaryDescriptorFromDescriptorDB.testErrorCollector.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=descriptor_pool_test, verbosity=2)

@ -0,0 +1,85 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import descriptor_test
import unittest
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_AllExtensions.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_EmptyMessage.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_FileDescriptor.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_ForeignEnum.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_ForeignNestedMessage.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_MethodDescriptor.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_NestedMessage.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_Options.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_ServiceDescriptor.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_SeveralExtensions.__unittest_expecting_failure__ = True
descriptor_test.DescriptorCopyToProtoTest.testCopyToProto_TypeError.__unittest_expecting_failure__ = True
descriptor_test.GeneratedDescriptorTest.testDescriptor.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testCamelcaseName.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testJsonName.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testMakeDescriptorWithNestedFields.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testMakeDescriptorWithOptions.__unittest_expecting_failure__ = True
descriptor_test.MakeDescriptorTest.testMakeDescriptorWithUnsignedIntField.__unittest_expecting_failure__ = True
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# NotImplementedError: unset repeated
#
# TODO: change to __unittest_expecting_failure__ when repeated fields are checked in.
descriptor_test.DescriptorTest.testAggregateOptions.__unittest_skip__ = True
descriptor_test.DescriptorTest.testComplexExtensionOptions.__unittest_skip__ = True
descriptor_test.DescriptorTest.testContainingServiceFixups.__unittest_skip__ = True
descriptor_test.DescriptorTest.testContainingTypeFixups.__unittest_skip__ = True
descriptor_test.DescriptorTest.testCustomOptionsCopyTo.__unittest_skip__ = True
descriptor_test.DescriptorTest.testDefault.__unittest_skip__ = True
descriptor_test.DescriptorTest.testDifferentCustomOptionTypes.__unittest_skip__ = True
descriptor_test.DescriptorTest.testEnumFixups.__unittest_skip__ = True
descriptor_test.DescriptorTest.testEnumValueName.__unittest_skip__ = True
descriptor_test.DescriptorTest.testFileDescriptor.__unittest_skip__ = True
descriptor_test.DescriptorTest.testFileDescriptorReferences.__unittest_skip__ = True
descriptor_test.DescriptorTest.testGetOptions.__unittest_skip__ = True
descriptor_test.DescriptorTest.testImmutableCppDescriptor.__unittest_skip__ = True
descriptor_test.DescriptorTest.testNestedOptions.__unittest_skip__ = True
descriptor_test.DescriptorTest.testSimpleCustomOptions.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testAggregateOptions.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testComplexExtensionOptions.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testContainingServiceFixups.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testContainingTypeFixups.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testCustomOptionsCopyTo.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testDefault.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testDifferentCustomOptionTypes.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testEnumFixups.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testEnumValueName.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testFileDescriptor.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testFileDescriptorReferences.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testGetOptions.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testImmutableCppDescriptor.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testNestedOptions.__unittest_skip__ = True
descriptor_test.NewDescriptorTest.testSimpleCustomOptions.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=descriptor_test, verbosity=2)

@ -0,0 +1,40 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import generator_test
import unittest
generator_test.GeneratorTest.testBadIdentifiers.__unittest_expecting_failure__ = True
generator_test.GeneratorTest.testExtensionScope.__unittest_expecting_failure__ = True
generator_test.GeneratorTest.testFileDescriptor.__unittest_expecting_failure__ = True
generator_test.GeneratorTest.testMessageWithCustomOptions.__unittest_expecting_failure__ = True
generator_test.GeneratorTest.testOneof.__unittest_expecting_failure__ = True
generator_test.GeneratorTest.testOptions.__unittest_expecting_failure__ = True
generator_test.SymbolDatabaseRegistrationTest.testEnums.__unittest_expecting_failure__ = True
generator_test.SymbolDatabaseRegistrationTest.testFindFileByName.__unittest_expecting_failure__ = True
generator_test.SymbolDatabaseRegistrationTest.testGetSymbol.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=generator_test, verbosity=2)

@ -0,0 +1,72 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import json_format_test
import unittest
json_format_test.JsonFormatTest.testAllFieldsToJson.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testAlwaysSeriliaze.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testAnyMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testAnyMessageDescriptorPoolMissingType.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testDurationMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testEmptyMessageToJson.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionSerializationDictMatchesProto3Spec.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionSerializationDictMatchesProto3SpecMore.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionSerializationJsonMatchesProto3Spec.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionToDictAndBack.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionToDictAndBackWithScalar.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testExtensionToJsonAndBack.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testFieldMaskMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testFloatPrecision.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testFormatEnumsAsInts.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testIgnoreUnknownField.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testIndent.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidAny.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidMap.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testInvalidTimestamp.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testJsonEscapeString.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testJsonName.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testJsonParseDictToAnyDoesNotAlterInput.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testListValueMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testMapFields.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testMessageToDict.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testNanFloat.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testNullValue.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testOneofFields.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testParseDictAnyDescriptorPoolMissingType.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testParseNull.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testPartialMessageToJson.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testPreservingProtoFieldNames.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testProto3Optional.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testSortKeys.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testStructMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testTimestampMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testUnknownEnumToJsonAndBack.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testValueMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testWellKnownInAnyMessage.__unittest_expecting_failure__ = True
json_format_test.JsonFormatTest.testWrapperMessage.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=json_format_test, verbosity=2)

@ -0,0 +1,35 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import keywords_test
import unittest
keywords_test.KeywordsConflictTest.testExtension.__unittest_expecting_failure__ = True
keywords_test.KeywordsConflictTest.testExtensionForNestedMessage.__unittest_expecting_failure__ = True
keywords_test.KeywordsConflictTest.testMessage.__unittest_expecting_failure__ = True
keywords_test.KeywordsConflictTest.testNestedMessage.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=keywords_test, verbosity=2)

@ -0,0 +1,41 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import message_factory_test
import unittest
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# AttributeError: 'google.protobuf.pyext._message.FileDescriptor' object has no attribute 'serialized_pb'
#
# TODO: change to __unittest_expecting_failure__ when serialized_pb is available.
message_factory_test.MessageFactoryTest.testCreatePrototypeOverride.__unittest_skip__ = True
message_factory_test.MessageFactoryTest.testDuplicateExtensionNumber.__unittest_skip__ = True
message_factory_test.MessageFactoryTest.testGetMessages.__unittest_skip__ = True
message_factory_test.MessageFactoryTest.testGetPrototype.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=message_factory_test, verbosity=2)

@ -0,0 +1,135 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import message_test
import unittest
message_test.MessageTest.testAppendRepeatedCompositeField_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testAppendRepeatedCompositeField_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testBadUtf8String_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testBadUtf8String_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendFloatWithNothing_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendFloatWithNothing_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendInt32WithNothing_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendInt32WithNothing_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendStringWithNothing_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testExtendStringWithNothing_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testFloatPrinting_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testFloatPrinting_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testGoldenMessage_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testGoldenMessage_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testGoldenPackedMessage_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testGoldenPackedMessage_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testHighPrecisionDoublePrinting_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testHighPrecisionDoublePrinting_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testInsertRepeatedCompositeField_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testInsertRepeatedCompositeField_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testLongValuedSlice_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testLongValuedSlice_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFromRepeatedField_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFromRepeatedField_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFromString_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFromString_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFrom_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testMergeFrom_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testOneofMessageMergeFrom_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testOneofMessageMergeFrom_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testOneofNestedMergeFrom_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testOneofNestedMergeFrom_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleNestedMessage_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleNestedMessage_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleNestedNestedMessage_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleNestedNestedMessage_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleSupport_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testPickleSupport_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedCompositeFieldPop_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedCompositeFieldPop_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedCompositeFieldSortArguments_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedCompositeFieldSortArguments_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedContains_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedContains_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedNestedFieldIteration_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testRepeatedNestedFieldIteration_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testSortingRepeatedCompositeFieldsCustomComparator_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testSortingRepeatedCompositeFieldsCustomComparator_proto3.__unittest_expecting_failure__ = True
message_test.MessageTest.testSortingRepeatedCompositeFieldsStable_proto2.__unittest_expecting_failure__ = True
message_test.MessageTest.testSortingRepeatedCompositeFieldsStable_proto3.__unittest_expecting_failure__ = True
message_test.Proto2Test.testExtensionsErrors.__unittest_expecting_failure__ = True
message_test.Proto2Test.testFieldPresence.__unittest_expecting_failure__ = True
message_test.Proto2Test.testGoldenExtensions.__unittest_expecting_failure__ = True
message_test.Proto2Test.testGoldenPackedExtensions.__unittest_expecting_failure__ = True
message_test.Proto2Test.testMergeFromExtensions.__unittest_expecting_failure__ = True
message_test.Proto2Test.testParsingMerge.__unittest_expecting_failure__ = True
message_test.Proto2Test.testPickleIncompleteProto.__unittest_expecting_failure__ = True
message_test.Proto2Test.testPythonicInit.__unittest_expecting_failure__ = True
message_test.Proto2Test.testUnknownEnumMap.__unittest_expecting_failure__ = True
message_test.Proto2Test.test_documentation.__unittest_expecting_failure__ = True
message_test.Proto3Test.testCopyFromBadType.__unittest_expecting_failure__ = True
message_test.Proto3Test.testFieldPresence.__unittest_expecting_failure__ = True
message_test.Proto3Test.testIntegerMapWithLongs.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapAssignmentCausesPresence.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapAssignmentCausesPresenceForSubmessages.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapByteSize.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapConstruction.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapDelete.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapDeterministicSerialization.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapEntryAlwaysSerialized.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapFieldRaisesCorrectError.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapFindInitializationErrorsSmokeTest.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapGet.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapItems.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapIterInvalidatedByClearField.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapIteration.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapIterationClearMessage.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapMergeFrom.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapMessageFieldConstruction.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapScalarFieldConstruction.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapValidAfterFieldCleared.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapsAreMapping.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMapsCompare.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMergeFrom.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMergeFromBadType.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMessageMap.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMessageMapItemValidAfterTopMessageCleared.__unittest_expecting_failure__ = True
message_test.Proto3Test.testMessageMapValidAfterFieldCleared.__unittest_expecting_failure__ = True
message_test.Proto3Test.testModifyMapWhileIterating.__unittest_expecting_failure__ = True
message_test.Proto3Test.testNestedMessageMapItemDelete.__unittest_expecting_failure__ = True
message_test.Proto3Test.testProto3Optional.__unittest_expecting_failure__ = True
message_test.Proto3Test.testProto3ParserDropDefaultScalar.__unittest_expecting_failure__ = True
message_test.Proto3Test.testScalarMap.__unittest_expecting_failure__ = True
message_test.Proto3Test.testScalarMapDefaults.__unittest_expecting_failure__ = True
message_test.Proto3Test.testStringUnicodeConversionInMap.__unittest_expecting_failure__ = True
message_test.Proto3Test.testSubmessageMap.__unittest_expecting_failure__ = True
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUpClass():
#
# NotImplementedError: unset repeated
#
# TODO: change to __unittest_expecting_failure__ when repeated fields are available
message_test.OversizeProtosTest.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=message_test, verbosity=2)

@ -0,0 +1,35 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import proto_builder_test
import unittest
proto_builder_test.ProtoBuilderTest.testMakeLargeProtoClass.__unittest_expecting_failure__ = True
proto_builder_test.ProtoBuilderTest.testMakeSameProtoClassTwice.__unittest_expecting_failure__ = True
proto_builder_test.ProtoBuilderTest.testMakeSimpleProtoClass.__unittest_expecting_failure__ = True
proto_builder_test.ProtoBuilderTest.testOrderedFields.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=proto_builder_test, verbosity=2)

@ -0,0 +1,150 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import reflection_test
import unittest
reflection_test.ByteSizeTest.testCacheInvalidationForNonrepeatedMessage.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testCacheInvalidationForNonrepeatedScalar.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testCacheInvalidationForRepeatedMessage.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testCacheInvalidationForRepeatedScalar.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testExtensions.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testPackedExtensions.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testRepeatedCompositesDelete.__unittest_expecting_failure__ = True
reflection_test.ByteSizeTest.testRepeatedScalarsRemove.__unittest_expecting_failure__ = True
reflection_test.ClassAPITest.testMakeClassWithNestedDescriptor.__unittest_expecting_failure__ = True
reflection_test.ClassAPITest.testParsingFlatClass.__unittest_expecting_failure__ = True
reflection_test.ClassAPITest.testParsingNestedClass.__unittest_expecting_failure__ = True
reflection_test.ExtensionEqualityTest.testExtensionEquality.__unittest_expecting_failure__ = True
reflection_test.MutualRecursionEqualityTest.testEqualityWithMutualRecursion.__unittest_expecting_failure__ = True
reflection_test.OptionsTest.testMessageOptions.__unittest_expecting_failure__ = True
reflection_test.OptionsTest.testPackedOptions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testClear.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testDisconnectingInOneof.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testDisconnectionAfterClearingEmptyMessage.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testExtensionContainsError.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testExtensionDelete.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testExtensionFailureModes.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testExtensionIter.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testHasBitsForAncestorsOfExtendedMessage.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testHasBitsForManyLevelsOfNesting.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testHasBitsWhenModifyingRepeatedFields.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testIsInitialized.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testListFieldsAndExtensions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testMergeFromExtensionsNestedMessage.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testMergeFromExtensionsRepeated.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testMergeFromExtensionsSingular.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testMergeFromOptionalGroup.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testNestedExtensions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRegisteredExtensions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedCompositeConstructor.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedCompositeRemove.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedCompositeReverse_Empty.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedCompositeReverse_NonEmpty.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedComposites.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedListExtensions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedScalars.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedScalarsRemove.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedScalarsReverse_Empty.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testRepeatedScalarsReverse_NonEmpty.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testSingularListExtensions.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testStringUTF8Serialization.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testTopLevelExtensionsForOptionalMessage.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testTopLevelExtensionsForOptionalScalar.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testTopLevelExtensionsForRepeatedMessage.__unittest_expecting_failure__ = True
reflection_test.Proto2ReflectionTest.testTopLevelExtensionsForRepeatedScalar.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testClearFieldWithUnknownFieldName_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testClearFieldWithUnknownFieldName_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testConstructorTypeError_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testConstructorTypeError_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testCopyFromAllFields_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testCopyFromAllFields_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.testDisconnectingBeforeClear_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testDisconnectingBeforeClear_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.testMergeFromAllFields_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testMergeFromAllFields_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testMergeFromRepeatedNestedMessage_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testMergeFromRepeatedNestedMessage_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testMixedConstructor_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testMixedConstructor_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testOneOf_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testOneOf_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testRepeatedListFields_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testRepeatedListFields_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testRepeatedScalarTypeSafety_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testRepeatedScalarTypeSafety_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testSingleScalarTypeSafety_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testSingleScalarTypeSafety_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testSingularListFields_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testSingularListFields_proto3.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testStaticParseFrom_proto2.__unittest_expecting_failure__ = True
reflection_test.ReflectionTest.testStaticParseFrom_proto3.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testCanonicalSerializationOrder.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testCanonicalSerializationOrderSameAsCpp.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testExtensionFieldNumbers.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testFieldDataDescriptor.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testFieldNumbers.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testFieldProperties.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testInitArgsUnknownFieldName.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testInitKwargs.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testInitRepeatedKwargs.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testInitRequiredForeignKwargs.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testInitRequiredKwargs.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testMergeFromStringWhenFieldsAlreadySet.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testMessageSetWireFormat.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testMessageSetWireFormatUnknownExtension.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testParsePackedFromUnpacked.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testParseUnpackedFromPacked.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeAllExtensions.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeAllFields.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeAllPackedExtensions.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeAllPackedFields.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeEmtpyMessage.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeNegativeValues.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeUninitialized.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeUninitializedSubMessage.__unittest_expecting_failure__ = True
reflection_test.SerializationTest.testSerializeWithOptionalGroup.__unittest_expecting_failure__ = True
reflection_test.TestAllTypesEqualityTest.testEmptyProtosEqual.__unittest_expecting_failure__ = True
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# NotImplementedError: access repeated
#
# TODO: change to __unittest_expecting_failure__ when repeated fields are available.
reflection_test.FullProtosEqualityTest.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=reflection_test, verbosity=2)

@ -0,0 +1,30 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import service_reflection_test
import unittest
if __name__ == '__main__':
unittest.main(module=service_reflection_test, verbosity=2)

@ -0,0 +1,39 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import symbol_database_test
import unittest
symbol_database_test.SymbolDatabaseTest.testEnums.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testFindFileByName.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testFindFileContainingSymbol.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testFindMessageTypeByName.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testFindServiceByName.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testGetMessages.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testGetPrototype.__unittest_expecting_failure__ = True
symbol_database_test.SymbolDatabaseTest.testGetSymbol.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=symbol_database_test, verbosity=2)

@ -0,0 +1,30 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import text_encoding_test
import unittest
if __name__ == '__main__':
unittest.main(module=text_encoding_test, verbosity=2)

@ -0,0 +1,202 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import text_format_test
import unittest
from google.protobuf.internal import _parameterized
sep = _parameterized._SEPARATOR
text_format_test.OnlyWorksWithProto2RightNowTests.testDuplicateMapKey.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testMapOrderEnforcement.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testMergeLinesGolden.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testParseGolden.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testParseLinesGolden.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintAllFields.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintAllFieldsPointy.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintInIndexOrder.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintMap.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintMapUsingCppImplementation.__unittest_expecting_failure__ = True
text_format_test.OnlyWorksWithProto2RightNowTests.testPrintUnknownFields.__unittest_expecting_failure__ = True
text_format_test.OptionalColonMessageToStringTest.testForcePrintOptionalColon.__unittest_expecting_failure__ = True
text_format_test.OptionalColonMessageToStringTest.testPrintShortFormatRepeatedFields.__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultiLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultiLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultiLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultiLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultipleParts" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintMultipleParts" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintNoMatch" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintNoMatch" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.PrettyPrinterTest, "testPrettyPrintOneLine" + sep + "1").__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testExtensionInsideAnyMessage.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testMergeDuplicateExtensionScalars.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseAllExtensions.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseAllowedUnknownExtension.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseBadExtension.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseDuplicateExtensionMessages.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseDuplicateExtensionScalars.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseGoldenExtensions.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseMap.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseMessageByFieldNumber.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testParseMessageSet.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testPrintAllExtensions.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testPrintAllExtensionsPointy.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testPrintMessageSet.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testPrintMessageSetAsOneLine.__unittest_expecting_failure__ = True
text_format_test.Proto2Tests.testPrintMessageSetByFieldNumber.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeAlternativeUrl.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeExpandedAny.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeExpandedAnyDescriptorPoolMissingType.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeExpandedAnyPointyBrackets.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeExpandedAnyRepeated.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeMissingAnyEndToken.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testMergeUnexpandedAny.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintAndParseMessageInvalidAny.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAny.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAnyAsOneLine.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAnyAsOneLinePointyBrackets.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAnyDescriptorPoolMissingType.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAnyPointyBrackets.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testPrintMessageExpandAnyRepeated.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testProto3Optional.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testTopAnyMessage.__unittest_expecting_failure__ = True
text_format_test.Proto3Tests.testUnknownEnums.__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testMergeDuplicateNestedMessageScalars" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testReplaceMessageInMessage" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testReplaceMessageInMessage" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testReplaceMessageInMessage" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMergeTests, "testReplaceMessageInMessage" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testCustomOptions" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringASCII" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testMessageToStringUnicode" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticUnicodeSubclass" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticUnicodeSubclass" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticUnicodeSubclass" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExoticUnicodeSubclass" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExotic" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExotic" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExotic" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintExotic" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatFormat" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatFormat" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatFormat" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatFormat" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatPrecision" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatPrecision" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatPrecision" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintFloatPrecision" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedMessageAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintNestedNewLineInStringAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRawUtf8String" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRepeatedFieldsAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRepeatedFieldsAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRepeatedFieldsAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintRepeatedFieldsAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintShortFormatRepeatedFields" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintShortFormatRepeatedFields" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintShortFormatRepeatedFields" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintShortFormatRepeatedFields" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testPrintUnknownFieldsEmbeddedMessageInBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testRoundTripExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testRoundTripExoticAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testRoundTripExoticAsOneLine" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToStringTests, "testRoundTripExoticAsOneLine" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testEscapedUtf8ASCIIRoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testMessageToBytes" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatMessageToTextBytesTests, "testRawUtf8RoundTrip" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAllFields" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAllFields" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAllFields" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAllFields" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAndMergeUtf8" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAndMergeUtf8" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAndMergeUtf8" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseAndMergeUtf8" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseEmptyText" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseEmptyText" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseEmptyText" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseEmptyText" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseOneof" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseRepeatedMessageShortFormat" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseUnknownField" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseUnknownField" + sep + "1").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseUnknownField" + sep + "0").__unittest_expecting_failure__ = True
getattr(text_format_test.TextFormatParserTests, "testParseUnknownField" + sep + "1").__unittest_expecting_failure__ = True
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# NotImplementedError: Conversion of message types not yet implemented
#
# TODO: change to __unittest_expecting_failure__ when message types can be converted
text_format_test.WhitespaceTest.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=text_format_test, verbosity=2)

@ -0,0 +1,58 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import unknown_fields_test
import unittest
# We must skip these tests entirely (rather than running them with
# __unittest_expecting_failure__) because they error out in setUp():
#
# NotImplementedError: access repeated
#
# TODO: change to __unittest_expecting_failure__ when repeated fields are available
unknown_fields_test.UnknownEnumValuesTest.testCheckUnknownFieldValueForEnum.__unittest_skip__ = True
unknown_fields_test.UnknownEnumValuesTest.testRoundTrip.__unittest_skip__ = True
unknown_fields_test.UnknownEnumValuesTest.testUnknownEnumValue.__unittest_skip__ = True
unknown_fields_test.UnknownEnumValuesTest.testUnknownPackedEnumValue.__unittest_skip__ = True
unknown_fields_test.UnknownEnumValuesTest.testUnknownParseMismatchEnumValue.__unittest_skip__ = True
unknown_fields_test.UnknownEnumValuesTest.testUnknownRepeatedEnumValue.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testCheckUnknownFieldValue.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testClear.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testCopyFrom.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testMergeFrom.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testSubUnknownFields.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownExtensions.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownField.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsAccessorsTest.testUnknownFieldsNoMemoryLeak.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testByteSize.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testDiscardUnknownFields.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testEquals.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testListFields.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testSerialize.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testSerializeMessageSetWireFormatUnknownExtension.__unittest_skip__ = True
unknown_fields_test.UnknownFieldsTest.testSerializeProto3.__unittest_skip__ = True
if __name__ == '__main__':
unittest.main(module=unknown_fields_test, verbosity=2)

@ -0,0 +1,44 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import well_known_types_test
import unittest
well_known_types_test.AnyTest.testAnyMessage.__unittest_expecting_failure__ = True
well_known_types_test.AnyTest.testPackDeterministic.__unittest_expecting_failure__ = True
well_known_types_test.AnyTest.testPackWithCustomTypeUrl.__unittest_expecting_failure__ = True
well_known_types_test.AnyTest.testUnpackWithNoSlashInTypeUrl.__unittest_expecting_failure__ = True
well_known_types_test.FieldMaskTest.testMergeMessageWithMapField.__unittest_expecting_failure__ = True
well_known_types_test.FieldMaskTest.testMergeMessageWithoutMapFields.__unittest_expecting_failure__ = True
well_known_types_test.StructTest.testMergeFrom.__unittest_expecting_failure__ = True
well_known_types_test.StructTest.testStruct.__unittest_expecting_failure__ = True
well_known_types_test.StructTest.testStructAssignment.__unittest_expecting_failure__ = True
well_known_types_test.TimeUtilTest.testDatetimeConversionWithTimezone.__unittest_expecting_failure__ = True
well_known_types_test.TimeUtilTest.testDurationSerializeAndParse.__unittest_expecting_failure__ = True
well_known_types_test.TimeUtilTest.testTimedeltaConversion.__unittest_expecting_failure__ = True
well_known_types_test.TimeUtilTest.testTimestampSerializeAndParse.__unittest_expecting_failure__ = True
if __name__ == '__main__':
unittest.main(module=well_known_types_test, verbosity=2)

@ -0,0 +1,30 @@
# Copyright (c) 2009-2021, Google LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Google LLC nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.protobuf.internal import wire_format_test
import unittest
if __name__ == '__main__':
unittest.main(module=wire_format_test, verbosity=2)

@ -241,15 +241,25 @@ PyObject* PyUpb_RepeatedContainer_ToList(PyObject* _self) {
const upb_fielddef* f = PyUpb_RepeatedContainer_GetField(self); const upb_fielddef* f = PyUpb_RepeatedContainer_GetField(self);
size_t n = upb_array_size(arr); size_t n = upb_array_size(arr);
PyObject* list = PyList_New(n); PyObject* list = PyList_New(n);
PyObject* ret = list;
if (!list) return NULL;
for (size_t i = 0; i < n; i++) { for (size_t i = 0; i < n; i++) {
PyObject* val = PyUpb_UpbToPy(upb_array_get(arr, i), f, self->arena); PyObject* val = PyUpb_UpbToPy(upb_array_get(arr, i), f, self->arena);
if (!val) {
val = Py_None;
Py_INCREF(val);
ret = NULL;
}
PyList_SetItem(list, i, val); PyList_SetItem(list, i, val);
} }
return list; if (ret != list) Py_DECREF(list);
return ret;
} }
static PyObject* PyUpb_RepeatedContainer_Repr(PyObject* _self) { static PyObject* PyUpb_RepeatedContainer_Repr(PyObject* _self) {
PyObject* list = PyUpb_RepeatedContainer_ToList(_self); PyObject* list = PyUpb_RepeatedContainer_ToList(_self);
if (!list) return NULL;
assert(!PyErr_Occurred());
PyObject* repr = PyObject_Repr(list); PyObject* repr = PyObject_Repr(list);
Py_DECREF(list); Py_DECREF(list);
return repr; return repr;
@ -285,12 +295,19 @@ static PyObject* PyUpb_RepeatedContainer_Subscript(PyObject* _self,
if (step == 0) { if (step == 0) {
return PyUpb_UpbToPy(upb_array_get(arr, idx), f, self->arena); return PyUpb_UpbToPy(upb_array_get(arr, idx), f, self->arena);
} else { } else {
PyObject* ret = PyList_New(count); PyObject* list = PyList_New(count);
PyObject* ret = list;
for (Py_ssize_t i = 0; i < count; i++, idx += step) { for (Py_ssize_t i = 0; i < count; i++, idx += step) {
upb_msgval msgval = upb_array_get(self->ptr.arr, idx); upb_msgval msgval = upb_array_get(self->ptr.arr, idx);
PyObject* item = PyUpb_UpbToPy(msgval, f, self->arena); PyObject* item = PyUpb_UpbToPy(msgval, f, self->arena);
PyList_SetItem(ret, i, item); if (!item) {
item = Py_None;
Py_INCREF(Py_None);
ret = NULL;
}
PyList_SetItem(list, i, item);
} }
if (ret != list) Py_DECREF(list);
return ret; return ret;
} }
} }
@ -355,7 +372,7 @@ static int PyUpb_RepeatedContainer_DeleteSubscript(upb_array* arr,
step = -step; step = -step;
} }
size_t dst = start; size_t dst = start;
size_t src = step ? start + 1 : start + count; size_t src = step > 1 ? start + 1 : start + count;
if (step > 1) { if (step > 1) {
// Move elements between steps. // Move elements between steps.
for (Py_ssize_t i = 0; i < count; i++, dst += step, src += step + 1) { for (Py_ssize_t i = 0; i < count; i++, dst += step, src += step + 1) {

@ -800,6 +800,9 @@ static void fastdecode_docopy(upb_decstate *d, const char *ptr, uint32_t size,
UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \
\ \
longstr: \ longstr: \
if (card == CARD_r) { \
fastdecode_commitarr(dst + 1, &farr, sizeof(upb_strview)); \
} \
ptr--; \ ptr--; \
if (validate_utf8) { \ if (validate_utf8) { \
UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \ UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \

Loading…
Cancel
Save