@@ -242,7 +242,10 @@ def test_get_response_enumerates_proto():
242242
243243
244244def test_get_response_divides_subpackages ():
245- g = make_generator ()
245+ # NOTE: autogen-snippets is intentionally disabled for this test
246+ # The API schema below is incomplete and will result in errors when the
247+ # snippetgen logic tries to parse it.
248+ g = make_generator ("autogen-snippets=false" )
246249 api_schema = api .API .build (
247250 [
248251 descriptor_pb2 .FileDescriptorProto (
@@ -277,7 +280,7 @@ def test_get_response_divides_subpackages():
277280 """ .strip ()
278281 )
279282 cgr = g .get_response (api_schema = api_schema ,
280- opts = Options .build ("" ))
283+ opts = Options .build ("autogen-snippets=false " ))
281284 assert len (cgr .file ) == 6
282285 assert {i .name for i in cgr .file } == {
283286 "foo/types/top.py" ,
@@ -683,7 +686,11 @@ def test_dont_generate_in_code_samples(mock_gmtime, mock_generate_sample, fs):
683686 ),
684687 )
685688
686- generator = make_generator (f"samples={ config_fpath } " )
689+ # NOTE: autogen-snippets is intentionally disabled for this test
690+ # The API schema below is incomplete and will result in errors when the
691+ # snippetgen logic attempts to parse it.
692+ generator = make_generator (f"samples={ config_fpath } ,autogen-snippets=False" )
693+ print (generator )
687694 generator ._env .loader = jinja2 .DictLoader ({"sample.py.j2" : "" })
688695 api_schema = make_api (
689696 make_proto (
@@ -743,7 +750,7 @@ def test_dont_generate_in_code_samples(mock_gmtime, mock_generate_sample, fs):
743750 expected .supported_features |= CodeGeneratorResponse .Feature .FEATURE_PROTO3_OPTIONAL
744751
745752 actual = generator .get_response (
746- api_schema = api_schema , opts = Options .build ("" )
753+ api_schema = api_schema , opts = Options .build ("autogen-snippets=False " )
747754 )
748755 assert actual == expected
749756
0 commit comments