From d51a92f2ea92bd58075862b1bfdad361630da04c Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Wed, 14 Aug 2024 14:56:12 +0200 Subject: [PATCH] More test --- tests/inputs/deprecated/deprecated.proto | 1 + tests/test_deprecated.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/inputs/deprecated/deprecated.proto b/tests/inputs/deprecated/deprecated.proto index d844be2ef..f504d03af 100644 --- a/tests/inputs/deprecated/deprecated.proto +++ b/tests/inputs/deprecated/deprecated.proto @@ -16,5 +16,6 @@ message Message { message Empty {} service TestService { + rpc func(Empty) returns (Empty); rpc deprecated_func(Empty) returns (Empty) { option deprecated = true; }; } diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py index 855094302..73ac8b558 100644 --- a/tests/test_deprecated.py +++ b/tests/test_deprecated.py @@ -50,11 +50,15 @@ def test_message_with_deprecated_field_not_set_default(message): @pytest.mark.asyncio async def test_service_with_deprecated_method(): - - stub = TestServiceStub(MockChannel([Empty()])) + stub = TestServiceStub(MockChannel([Empty(), Empty()])) with pytest.warns(DeprecationWarning) as record: await stub.deprecated_func(Empty()) assert len(record) == 1 assert str(record[0].message) == f"TestService.deprecated_func is deprecated" + + with pytest.warns(None) as record: + await stub.func(Empty()) + + assert not record \ No newline at end of file