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

Commit 940b492

Browse files
committed
fix tests
1 parent f1a2a3a commit 940b492

12 files changed

Lines changed: 23 additions & 33 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,7 @@ def test_{{ service.name|snake_case }}_grpc_asyncio_transport_channel():
14721472

14731473
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
14741474
# removed from grpc/grpc_asyncio transport constructor.
1475+
@pytest.mark.filterwarnings("ignore::FutureWarning")
14751476
@pytest.mark.parametrize("transport_class", [transports.{{ service.grpc_transport_name }}, transports.{{ service.grpc_asyncio_transport_name }}])
14761477
def test_{{ service.name|snake_case }}_transport_channel_mtls_with_client_cert_source(
14771478
transport_class

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17726,7 +17726,7 @@ def test_asset_service_transport_channel_mtls_with_client_cert_source(
1772617726
grpc_create_channel.return_value = mock_grpc_channel
1772717727

1772817728
cred = ga_credentials.AnonymousCredentials()
17729-
with pytest.warns(DeprecationWarning) as record:
17729+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1773017730
with mock.patch.object(google.auth, 'default') as adc:
1773117731
adc.return_value = (cred, None)
1773217732
transport = transport_class(
@@ -17758,7 +17758,6 @@ def test_asset_service_transport_channel_mtls_with_client_cert_source(
1775817758

1775917759
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1776017760
# removed from grpc/grpc_asyncio transport constructor.
17761-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1776217761
@pytest.mark.parametrize("transport_class", [transports.AssetServiceGrpcTransport, transports.AssetServiceGrpcAsyncIOTransport])
1776317762
def test_asset_service_transport_channel_mtls_with_adc(
1776417763
transport_class
@@ -17774,7 +17773,7 @@ def test_asset_service_transport_channel_mtls_with_adc(
1777417773
grpc_create_channel.return_value = mock_grpc_channel
1777517774
mock_cred = mock.Mock()
1777617775

17777-
with pytest.warns(DeprecationWarning) as record:
17776+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1777817777
transport = transport_class(
1777917778
host="squid.clam.whelk",
1778017779
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3986,7 +3986,7 @@ def test_iam_credentials_transport_channel_mtls_with_client_cert_source(
39863986
grpc_create_channel.return_value = mock_grpc_channel
39873987

39883988
cred = ga_credentials.AnonymousCredentials()
3989-
with pytest.warns(DeprecationWarning) as record:
3989+
with pytest.warns(DeprecationWarning, match="mtls") as record:
39903990
with mock.patch.object(google.auth, 'default') as adc:
39913991
adc.return_value = (cred, None)
39923992
transport = transport_class(
@@ -4018,7 +4018,6 @@ def test_iam_credentials_transport_channel_mtls_with_client_cert_source(
40184018

40194019
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
40204020
# removed from grpc/grpc_asyncio transport constructor.
4021-
@pytest.mark.filterwarnings("ignore::FutureWarning")
40224021
@pytest.mark.parametrize("transport_class", [transports.IAMCredentialsGrpcTransport, transports.IAMCredentialsGrpcAsyncIOTransport])
40234022
def test_iam_credentials_transport_channel_mtls_with_adc(
40244023
transport_class
@@ -4034,7 +4033,7 @@ def test_iam_credentials_transport_channel_mtls_with_adc(
40344033
grpc_create_channel.return_value = mock_grpc_channel
40354034
mock_cred = mock.Mock()
40364035

4037-
with pytest.warns(DeprecationWarning) as record:
4036+
with pytest.warns(DeprecationWarning, match="mtls") as record:
40384037
transport = transport_class(
40394038
host="squid.clam.whelk",
40404039
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15392,7 +15392,7 @@ def test_eventarc_transport_channel_mtls_with_client_cert_source(
1539215392
grpc_create_channel.return_value = mock_grpc_channel
1539315393

1539415394
cred = ga_credentials.AnonymousCredentials()
15395-
with pytest.warns(DeprecationWarning) as record:
15395+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1539615396
with mock.patch.object(google.auth, 'default') as adc:
1539715397
adc.return_value = (cred, None)
1539815398
transport = transport_class(
@@ -15424,7 +15424,6 @@ def test_eventarc_transport_channel_mtls_with_client_cert_source(
1542415424

1542515425
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1542615426
# removed from grpc/grpc_asyncio transport constructor.
15427-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1542815427
@pytest.mark.parametrize("transport_class", [transports.EventarcGrpcTransport, transports.EventarcGrpcAsyncIOTransport])
1542915428
def test_eventarc_transport_channel_mtls_with_adc(
1543015429
transport_class
@@ -15440,7 +15439,7 @@ def test_eventarc_transport_channel_mtls_with_adc(
1544015439
grpc_create_channel.return_value = mock_grpc_channel
1544115440
mock_cred = mock.Mock()
1544215441

15443-
with pytest.warns(DeprecationWarning) as record:
15442+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1544415443
transport = transport_class(
1544515444
host="squid.clam.whelk",
1544615445
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12911,7 +12911,7 @@ def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1291112911
grpc_create_channel.return_value = mock_grpc_channel
1291212912

1291312913
cred = ga_credentials.AnonymousCredentials()
12914-
with pytest.warns(DeprecationWarning) as record:
12914+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1291512915
with mock.patch.object(google.auth, 'default') as adc:
1291612916
adc.return_value = (cred, None)
1291712917
transport = transport_class(
@@ -12943,7 +12943,6 @@ def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1294312943

1294412944
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1294512945
# removed from grpc/grpc_asyncio transport constructor.
12946-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1294712946
@pytest.mark.parametrize("transport_class", [transports.ConfigServiceV2GrpcTransport, transports.ConfigServiceV2GrpcAsyncIOTransport])
1294812947
def test_config_service_v2_transport_channel_mtls_with_adc(
1294912948
transport_class
@@ -12959,7 +12958,7 @@ def test_config_service_v2_transport_channel_mtls_with_adc(
1295912958
grpc_create_channel.return_value = mock_grpc_channel
1296012959
mock_cred = mock.Mock()
1296112960

12962-
with pytest.warns(DeprecationWarning) as record:
12961+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1296312962
transport = transport_class(
1296412963
host="squid.clam.whelk",
1296512964
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34593459
grpc_create_channel.return_value = mock_grpc_channel
34603460

34613461
cred = ga_credentials.AnonymousCredentials()
3462-
with pytest.warns(DeprecationWarning) as record:
3462+
with pytest.warns(DeprecationWarning, match="mtls") as record:
34633463
with mock.patch.object(google.auth, 'default') as adc:
34643464
adc.return_value = (cred, None)
34653465
transport = transport_class(
@@ -3491,7 +3491,6 @@ def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34913491

34923492
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
34933493
# removed from grpc/grpc_asyncio transport constructor.
3494-
@pytest.mark.filterwarnings("ignore::FutureWarning")
34953494
@pytest.mark.parametrize("transport_class", [transports.LoggingServiceV2GrpcTransport, transports.LoggingServiceV2GrpcAsyncIOTransport])
34963495
def test_logging_service_v2_transport_channel_mtls_with_adc(
34973496
transport_class
@@ -3507,7 +3506,7 @@ def test_logging_service_v2_transport_channel_mtls_with_adc(
35073506
grpc_create_channel.return_value = mock_grpc_channel
35083507
mock_cred = mock.Mock()
35093508

3510-
with pytest.warns(DeprecationWarning) as record:
3509+
with pytest.warns(DeprecationWarning, match="mtls") as record:
35113510
transport = transport_class(
35123511
host="squid.clam.whelk",
35133512
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,7 +3263,7 @@ def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32633263
grpc_create_channel.return_value = mock_grpc_channel
32643264

32653265
cred = ga_credentials.AnonymousCredentials()
3266-
with pytest.warns(DeprecationWarning) as record:
3266+
with pytest.warns(DeprecationWarning, match="mtls") as record:
32673267
with mock.patch.object(google.auth, 'default') as adc:
32683268
adc.return_value = (cred, None)
32693269
transport = transport_class(
@@ -3295,7 +3295,6 @@ def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32953295

32963296
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
32973297
# removed from grpc/grpc_asyncio transport constructor.
3298-
@pytest.mark.filterwarnings("ignore::FutureWarning")
32993298
@pytest.mark.parametrize("transport_class", [transports.MetricsServiceV2GrpcTransport, transports.MetricsServiceV2GrpcAsyncIOTransport])
33003299
def test_metrics_service_v2_transport_channel_mtls_with_adc(
33013300
transport_class
@@ -3311,7 +3310,7 @@ def test_metrics_service_v2_transport_channel_mtls_with_adc(
33113310
grpc_create_channel.return_value = mock_grpc_channel
33123311
mock_cred = mock.Mock()
33133312

3314-
with pytest.warns(DeprecationWarning) as record:
3313+
with pytest.warns(DeprecationWarning, match="mtls") as record:
33153314
transport = transport_class(
33163315
host="squid.clam.whelk",
33173316
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12911,7 +12911,7 @@ def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1291112911
grpc_create_channel.return_value = mock_grpc_channel
1291212912

1291312913
cred = ga_credentials.AnonymousCredentials()
12914-
with pytest.warns(DeprecationWarning) as record:
12914+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1291512915
with mock.patch.object(google.auth, 'default') as adc:
1291612916
adc.return_value = (cred, None)
1291712917
transport = transport_class(
@@ -12943,7 +12943,6 @@ def test_config_service_v2_transport_channel_mtls_with_client_cert_source(
1294312943

1294412944
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
1294512945
# removed from grpc/grpc_asyncio transport constructor.
12946-
@pytest.mark.filterwarnings("ignore::FutureWarning")
1294712946
@pytest.mark.parametrize("transport_class", [transports.ConfigServiceV2GrpcTransport, transports.ConfigServiceV2GrpcAsyncIOTransport])
1294812947
def test_config_service_v2_transport_channel_mtls_with_adc(
1294912948
transport_class
@@ -12959,7 +12958,7 @@ def test_config_service_v2_transport_channel_mtls_with_adc(
1295912958
grpc_create_channel.return_value = mock_grpc_channel
1296012959
mock_cred = mock.Mock()
1296112960

12962-
with pytest.warns(DeprecationWarning) as record:
12961+
with pytest.warns(DeprecationWarning, match="mtls") as record:
1296312962
transport = transport_class(
1296412963
host="squid.clam.whelk",
1296512964
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34593459
grpc_create_channel.return_value = mock_grpc_channel
34603460

34613461
cred = ga_credentials.AnonymousCredentials()
3462-
with pytest.warns(DeprecationWarning) as record:
3462+
with pytest.warns(DeprecationWarning, match="mtls") as record:
34633463
with mock.patch.object(google.auth, 'default') as adc:
34643464
adc.return_value = (cred, None)
34653465
transport = transport_class(
@@ -3491,7 +3491,6 @@ def test_logging_service_v2_transport_channel_mtls_with_client_cert_source(
34913491

34923492
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
34933493
# removed from grpc/grpc_asyncio transport constructor.
3494-
@pytest.mark.filterwarnings("ignore::FutureWarning")
34953494
@pytest.mark.parametrize("transport_class", [transports.LoggingServiceV2GrpcTransport, transports.LoggingServiceV2GrpcAsyncIOTransport])
34963495
def test_logging_service_v2_transport_channel_mtls_with_adc(
34973496
transport_class
@@ -3507,7 +3506,7 @@ def test_logging_service_v2_transport_channel_mtls_with_adc(
35073506
grpc_create_channel.return_value = mock_grpc_channel
35083507
mock_cred = mock.Mock()
35093508

3510-
with pytest.warns(DeprecationWarning) as record:
3509+
with pytest.warns(DeprecationWarning, match="mtls") as record:
35113510
transport = transport_class(
35123511
host="squid.clam.whelk",
35133512
credentials=mock_cred,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,7 +3263,7 @@ def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32633263
grpc_create_channel.return_value = mock_grpc_channel
32643264

32653265
cred = ga_credentials.AnonymousCredentials()
3266-
with pytest.warns(DeprecationWarning) as record:
3266+
with pytest.warns(DeprecationWarning, match="mtls") as record:
32673267
with mock.patch.object(google.auth, 'default') as adc:
32683268
adc.return_value = (cred, None)
32693269
transport = transport_class(
@@ -3295,7 +3295,6 @@ def test_metrics_service_v2_transport_channel_mtls_with_client_cert_source(
32953295

32963296
# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are
32973297
# removed from grpc/grpc_asyncio transport constructor.
3298-
@pytest.mark.filterwarnings("ignore::FutureWarning")
32993298
@pytest.mark.parametrize("transport_class", [transports.MetricsServiceV2GrpcTransport, transports.MetricsServiceV2GrpcAsyncIOTransport])
33003299
def test_metrics_service_v2_transport_channel_mtls_with_adc(
33013300
transport_class
@@ -3311,7 +3310,7 @@ def test_metrics_service_v2_transport_channel_mtls_with_adc(
33113310
grpc_create_channel.return_value = mock_grpc_channel
33123311
mock_cred = mock.Mock()
33133312

3314-
with pytest.warns(DeprecationWarning) as record:
3313+
with pytest.warns(DeprecationWarning, match="mtls") as record:
33153314
transport = transport_class(
33163315
host="squid.clam.whelk",
33173316
credentials=mock_cred,

0 commit comments

Comments
 (0)