Skip to content

Commit 802dd5b

Browse files
committed
address PR feedback
1 parent 677280e commit 802dd5b

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

tests/asyncio/test_grpc_helpers_async.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ def test_create_channel_explicit_with_duplicate_credentials():
522522
target = "example:443"
523523

524524
with pytest.raises(exceptions.DuplicateCredentialArgs) as excinfo:
525+
# The `credentials_file` argument is deprecated by
526+
# the Google Cloud Auth library (`google-auth`), which is the
527+
# upstream dependency responsible for handling authentication.
525528
with pytest.warns(DeprecationWarning):
526529
grpc_helpers_async.create_channel(
527530
target,
@@ -643,6 +646,9 @@ def test_create_channel_with_credentials_file(
643646
composite_creds = composite_creds_call.return_value
644647

645648
with pytest.warns(DeprecationWarning):
649+
# The `credentials_file` argument is deprecated by
650+
# the Google Cloud Auth library (`google-auth`), which is the
651+
# upstream dependency responsible for handling authentication.
646652
channel = grpc_helpers_async.create_channel(
647653
target, credentials_file=credentials_file
648654
)
@@ -673,6 +679,9 @@ def test_create_channel_with_credentials_file_and_scopes(
673679
composite_creds = composite_creds_call.return_value
674680

675681
with pytest.warns(DeprecationWarning):
682+
# The `credentials_file` argument is deprecated by
683+
# the Google Cloud Auth library (`google-auth`), which is the
684+
# upstream dependency responsible for handling authentication.
676685
channel = grpc_helpers_async.create_channel(
677686
target, credentials_file=credentials_file, scopes=scopes
678687
)
@@ -703,6 +712,9 @@ def test_create_channel_with_credentials_file_and_default_scopes(
703712
composite_creds = composite_creds_call.return_value
704713

705714
with pytest.warns(DeprecationWarning):
715+
# The `credentials_file` argument is deprecated by
716+
# the Google Cloud Auth library (`google-auth`), which is the
717+
# upstream dependency responsible for handling authentication.
706718
channel = grpc_helpers_async.create_channel(
707719
target, credentials_file=credentials_file, default_scopes=default_scopes
708720
)

tests/unit/operations_v1/test_operations_rest_client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ def test_operations_client_client_options(
370370

371371
# Check the case credentials_file is provided
372372
with pytest.warns(DeprecationWarning):
373+
# The `credentials_file` argument is deprecated by
374+
# the Google Cloud Auth library (`google-auth`), which is the
375+
# upstream dependency responsible for handling authentication.
373376
options = client_options.ClientOptions(credentials_file="credentials.json")
374377
with mock.patch.object(transport_class, "__init__") as patched:
375378
patched.return_value = None
@@ -541,6 +544,9 @@ def test_operations_client_client_options_credentials_file(
541544
):
542545
# Check the case credentials file is provided.
543546
with pytest.warns(DeprecationWarning):
547+
# The `credentials_file` argument is deprecated by
548+
# the Google Cloud Auth library (`google-auth`), which is the
549+
# upstream dependency responsible for handling authentication.
544550
options = client_options.ClientOptions(credentials_file="credentials.json")
545551
if "async" in str(client_class):
546552
with mock.patch.object(transport_class, "__init__") as patched:
@@ -584,6 +590,9 @@ def test_operations_client_client_options_credentials_file(
584590
def test_list_operations_rest(google_auth_default, credentials_file):
585591
if credentials_file is not None:
586592
with pytest.warns(DeprecationWarning):
593+
# The `credentials_file` argument is deprecated by
594+
# the Google Cloud Auth library (`google-auth`), which is the
595+
# upstream dependency responsible for handling authentication.
587596
sync_transport = transports.rest.OperationsRestTransport(
588597
credentials_file=credentials_file,
589598
http_options=HTTP_OPTIONS,
@@ -1150,6 +1159,9 @@ def test_operations_base_transport_error():
11501159
# Passing both a credentials object and credentials_file should raise an error
11511160
with pytest.raises(core_exceptions.DuplicateCredentialArgs):
11521161
with pytest.warns(DeprecationWarning):
1162+
# The `credentials_file` argument is deprecated by
1163+
# the Google Cloud Auth library (`google-auth`), which is the
1164+
# upstream dependency responsible for handling authentication.
11531165
transports.OperationsTransport(
11541166
credentials=ga_credentials.AnonymousCredentials(),
11551167
credentials_file="credentials.json",
@@ -1192,6 +1204,9 @@ def test_operations_base_transport_with_credentials_file():
11921204
Transport.return_value = None
11931205
load_creds.return_value = (ga_credentials.AnonymousCredentials(), None)
11941206
with pytest.warns(DeprecationWarning):
1207+
# The `credentials_file` argument is deprecated by
1208+
# the Google Cloud Auth library (`google-auth`), which is the
1209+
# upstream dependency responsible for handling authentication.
11951210
transports.OperationsTransport(
11961211
credentials_file="credentials.json",
11971212
quota_project_id="octopus",

tests/unit/test_client_options.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def get_client_encrypted_cert():
2828

2929
def test_constructor():
3030
with pytest.warns(DeprecationWarning):
31+
# The `credentials_file` argument is deprecated by
32+
# the Google Cloud Auth library (`google-auth`), which is the
33+
# upstream dependency responsible for handling authentication.
3134
options = client_options.ClientOptions(
3235
api_endpoint="foo.googleapis.com",
3336
client_cert_source=get_client_cert,
@@ -103,6 +106,9 @@ def test_constructor_with_api_key():
103106
def test_constructor_with_both_api_key_and_credentials_file():
104107
with pytest.raises(ValueError):
105108
with pytest.warns(DeprecationWarning):
109+
# The `credentials_file` argument is deprecated by
110+
# the Google Cloud Auth library (`google-auth`), which is the
111+
# upstream dependency responsible for handling authentication.
106112
client_options.ClientOptions(
107113
api_key="api-key",
108114
credentials_file="path/to/credentials.json",

tests/unit/test_grpc_helpers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ def test_create_channel_explicit_with_duplicate_credentials():
582582

583583
with pytest.raises(exceptions.DuplicateCredentialArgs):
584584
with pytest.warns(DeprecationWarning):
585+
# The `credentials_file` argument is deprecated by
586+
# the Google Cloud Auth library (`google-auth`), which is the
587+
# upstream dependency responsible for handling authentication.
585588
grpc_helpers.create_channel(
586589
target,
587590
credentials_file="credentials.json",
@@ -712,6 +715,9 @@ def test_create_channel_with_credentials_file(
712715
composite_creds = composite_creds_call.return_value
713716

714717
with pytest.warns(DeprecationWarning):
718+
# The `credentials_file` argument is deprecated by
719+
# the Google Cloud Auth library (`google-auth`), which is the
720+
# upstream dependency responsible for handling authentication.
715721
channel = grpc_helpers.create_channel(target, credentials_file=credentials_file)
716722

717723
google.auth.load_credentials_from_file.assert_called_once_with(
@@ -745,6 +751,9 @@ def test_create_channel_with_credentials_file_and_scopes(
745751
composite_creds = composite_creds_call.return_value
746752

747753
with pytest.warns(DeprecationWarning):
754+
# The `credentials_file` argument is deprecated by
755+
# the Google Cloud Auth library (`google-auth`), which is the
756+
# upstream dependency responsible for handling authentication.
748757
channel = grpc_helpers.create_channel(
749758
target, credentials_file=credentials_file, scopes=scopes
750759
)
@@ -780,6 +789,9 @@ def test_create_channel_with_credentials_file_and_default_scopes(
780789
composite_creds = composite_creds_call.return_value
781790

782791
with pytest.warns(DeprecationWarning):
792+
# The `credentials_file` argument is deprecated by
793+
# the Google Cloud Auth library (`google-auth`), which is the
794+
# upstream dependency responsible for handling authentication.
783795
channel = grpc_helpers.create_channel(
784796
target, credentials_file=credentials_file, default_scopes=default_scopes
785797
)

0 commit comments

Comments
 (0)