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

Commit 4e4f40e

Browse files
taimo3810claude
andcommitted
fix: remove __func__ from static method access in tests
The _get_response method is a @staticmethod, so it can be called directly without using __func__. Using __func__ on a static method accessed through a class raises AttributeError. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d35d541 commit 4e4f40e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,8 +1476,8 @@ def test_{{ method_name }}_rest_url_query_params_encoding():
14761476
# when building the URL query string. This tests the urlencode call with safe="$".
14771477
transport = transports.{{ service.rest_transport_name }}(credentials=ga_credentials.AnonymousCredentials)
14781478
method_class = transport.{{ method.transport_safe_name|snake_case }}.__class__
1479-
# Get the _get_response method from the method class
1480-
get_response_fn = method_class._get_response.__func__
1479+
# Get the _get_response static method from the method class
1480+
get_response_fn = method_class._get_response
14811481

14821482
mock_session = mock.Mock()
14831483
mock_response = mock.Mock()

gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,8 @@ def test_{{ method_name }}_rest_url_query_params_encoding():
12221222
# when building the URL query string. This tests the urlencode call with safe="$".
12231223
transport = transports.{{ service.rest_transport_name }}(credentials=ga_credentials.AnonymousCredentials)
12241224
method_class = transport.{{ method.transport_safe_name|snake_case }}.__class__
1225-
# Get the _get_response method from the method class
1226-
get_response_fn = method_class._get_response.__func__
1225+
# Get the _get_response static method from the method class
1226+
get_response_fn = method_class._get_response
12271227

12281228
mock_session = mock.Mock()
12291229
mock_response = mock.Mock()

0 commit comments

Comments
 (0)