Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit ac15f52

Browse files
committed
fix: filter MTLS deprecation tests for "mtls"
1 parent 801a787 commit ac15f52

File tree

12 files changed

+13
-3
lines changed

12 files changed

+13
-3
lines changed

gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
14851485
grpc_create_channel.return_value = mock_grpc_channel
14861486

14871487
cred = ga_credentials.AnonymousCredentials()
1488-
with pytest.warns(DeprecationWarning) as record:
1488+
with pytest.warns(DeprecationWarning, match="mtls") as record:
14891489
with mock.patch.object(google.auth, 'default') as adc:
14901490
adc.return_value = (cred, None)
14911491
transport = transport_class(
@@ -1517,7 +1517,6 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_s
15171517

15181518
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
15191519
# removed from grpc/grpc_asyncio transport constructor.
1520-
@pytest.mark.filterwarnings("ignore::FutureWarning")
15211520
@pytest.mark.parametrize("transport_class", [transports.{{ service.grpc_transport_name }}, transports.{{ service.grpc_asyncio_transport_name }}])
15221521
def test_{{ service.name|snake_case }}_transport_channel_mtls_with_adc(
15231522
transport_class
@@ -1533,7 +1532,7 @@ def test_{{ service.name|snake_case }}_transport_channel_mtls_with_adc(
15331532
grpc_create_channel.return_value = mock_grpc_channel
15341533
mock_cred = mock.Mock()
15351534

1536-
with pytest.warns(DeprecationWarning) as record:
1535+
with pytest.warns(DeprecationWarning, match="mtls") as record:
15371536
transport = transport_class(
15381537
host="squid.clam.whelk",
15391538
credentials=mock_cred,

tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17712,6 +17712,7 @@ def test_asset_service_grpc_asyncio_transport_channel():
1771217712

1771317713
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1771417714
# removed from grpc/grpc_asyncio transport constructor.
17715+
@pytest.mark.filterwarnings("ignore::FutureWarning")
1771517716
@pytest.mark.parametrize("transport_class", [transports.AssetServiceGrpcTransport, transports.AssetServiceGrpcAsyncIOTransport])
1771617717
def test_asset_service_transport_channel_mtls_with_client_cert_source(
1771717718
transport_class

tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,6 +3972,7 @@ def test_iam_credentials_grpc_asyncio_transport_channel():
39723972

39733973
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
39743974
# removed from grpc/grpc_asyncio transport constructor.
3975+
@pytest.mark.filterwarnings("ignore::FutureWarning")
39753976
@pytest.mark.parametrize("transport_class", [transports.IAMCredentialsGrpcTransport, transports.IAMCredentialsGrpcAsyncIOTransport])
39763977
def test_iam_credentials_transport_channel_mtls_with_client_cert_source(
39773978
transport_class

tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15378,6 +15378,7 @@ def test_eventarc_grpc_asyncio_transport_channel():
1537815378

1537915379
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1538015380
# removed from grpc/grpc_asyncio transport constructor.
15381+
@pytest.mark.filterwarnings("ignore::FutureWarning")
1538115382
@pytest.mark.parametrize("transport_class", [transports.EventarcGrpcTransport, transports.EventarcGrpcAsyncIOTransport])
1538215383
def test_eventarc_transport_channel_mtls_with_client_cert_source(
1538315384
transport_class

tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_config_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12897,6 +12897,7 @@ def test_config_service_v2_grpc_asyncio_transport_channel():
1289712897

1289812898
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1289912899
# removed from grpc/grpc_asyncio transport constructor.
12900+
@pytest.mark.filterwarnings("ignore::FutureWarning")
1290012901
@pytest.mark.parametrize("transport_class", [transports.ConfigServiceV2GrpcTransport, transports.ConfigServiceV2GrpcAsyncIOTransport])
1290112902
def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1290212903
transport_class

tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_logging_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,6 +3445,7 @@ def test_logging_service_v2_grpc_asyncio_transport_channel():
34453445

34463446
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
34473447
# removed from grpc/grpc_asyncio transport constructor.
3448+
@pytest.mark.filterwarnings("ignore::FutureWarning")
34483449
@pytest.mark.parametrize("transport_class", [transports.LoggingServiceV2GrpcTransport, transports.LoggingServiceV2GrpcAsyncIOTransport])
34493450
def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34503451
transport_class

tests/integration/goldens/logging/tests/unit/gapic/logging_v2/test_metrics_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,6 +3249,7 @@ def test_metrics_service_v2_grpc_asyncio_transport_channel():
32493249

32503250
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
32513251
# removed from grpc/grpc_asyncio transport constructor.
3252+
@pytest.mark.filterwarnings("ignore::FutureWarning")
32523253
@pytest.mark.parametrize("transport_class", [transports.MetricsServiceV2GrpcTransport, transports.MetricsServiceV2GrpcAsyncIOTransport])
32533254
def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32543255
transport_class

tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_config_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12897,6 +12897,7 @@ def test_config_service_v2_grpc_asyncio_transport_channel():
1289712897

1289812898
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1289912899
# removed from grpc/grpc_asyncio transport constructor.
12900+
@pytest.mark.filterwarnings("ignore::FutureWarning")
1290012901
@pytest.mark.parametrize("transport_class", [transports.ConfigServiceV2GrpcTransport, transports.ConfigServiceV2GrpcAsyncIOTransport])
1290112902
def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1290212903
transport_class

tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_logging_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,6 +3445,7 @@ def test_logging_service_v2_grpc_asyncio_transport_channel():
34453445

34463446
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
34473447
# removed from grpc/grpc_asyncio transport constructor.
3448+
@pytest.mark.filterwarnings("ignore::FutureWarning")
34483449
@pytest.mark.parametrize("transport_class", [transports.LoggingServiceV2GrpcTransport, transports.LoggingServiceV2GrpcAsyncIOTransport])
34493450
def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34503451
transport_class

tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/test_metrics_service_v2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3249,6 +3249,7 @@ def test_metrics_service_v2_grpc_asyncio_transport_channel():
32493249

32503250
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
32513251
# removed from grpc/grpc_asyncio transport constructor.
3252+
@pytest.mark.filterwarnings("ignore::FutureWarning")
32523253
@pytest.mark.parametrize("transport_class", [transports.MetricsServiceV2GrpcTransport, transports.MetricsServiceV2GrpcAsyncIOTransport])
32533254
def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32543255
transport_class

0 commit comments

Comments
 (0)