From #1975 (comment) in PR #1975,
See suggestion below to improve readability of tests that require building descriptors from protos.
If it's trivial to read from a proto "file" (string) in tests, it might be simpler to simply encode the protofile inline rather than calling make_file_pb2
Something like this
proto_descriptor = make_protodescriptor("""
package xx;
message Foo {
string foo = 1;
}
""")
instead of
fd = (
make_file_pb2(
name="someexample.proto",
package="google.example.v1beta1",
messages=(
make_message_pb2(name="ExampleRequest", fields=fields),
make_message_pb2(name="ExampleResponse", fields=()),
),
services=(
descriptor_pb2.ServiceDescriptorProto(
name="SomeExample",
would improve readability