This is an automated email from the ASF dual-hosted git repository.

chamikaramj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a9afdccb5d Fix bigquery_tools_test to mock gcp_bigquery library 
instead... (#40676)
8a9afdccb5d is described below

commit 8a9afdccb5d6bccd724638d09d5d8ba5db84e53a
Author: Chamikara Jayalath <[email protected]>
AuthorDate: Tue Oct 20 12:37:05 2026 -0700

    Fix bigquery_tools_test to mock gcp_bigquery library instead... (#40676)
---
 sdks/python/apache_beam/io/gcp/bigquery_tools_test.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py 
b/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
index de4f3e4066a..6df9f6c5c14 100644
--- a/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
+++ b/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
@@ -1697,15 +1697,17 @@ class 
TestBigQueryWrapperQuotaProject(unittest.TestCase):
     for headers in token_request_headers:
       self.assertNotIn('x-goog-user-project', headers)
 
-  @mock.patch('apache_beam.io.gcp.bigquery_tools.gcp_bigquery.Client')
-  def test_gcp_bigquery_client_passes_quota_project(self, mock_client):
+  @mock.patch('apache_beam.io.gcp.bigquery_tools.gcp_bigquery')
+  def test_gcp_bigquery_client_passes_quota_project(self, mock_gcp_bq):
+    mock_client = mock_gcp_bq.Client
     BigQueryWrapper._gcp_bigquery_client(quota_project_id='my-billing-project')
     self.assertEqual(
         mock_client.call_args.kwargs['client_options'],
         {'quota_project_id': 'my-billing-project'})
 
-  @mock.patch('apache_beam.io.gcp.bigquery_tools.gcp_bigquery.Client')
-  def test_gcp_bigquery_client_no_quota_project_by_default(self, mock_client):
+  @mock.patch('apache_beam.io.gcp.bigquery_tools.gcp_bigquery')
+  def test_gcp_bigquery_client_no_quota_project_by_default(self, mock_gcp_bq):
+    mock_client = mock_gcp_bq.Client
     BigQueryWrapper._gcp_bigquery_client()
     self.assertIsNone(mock_client.call_args.kwargs['client_options'])
 

Reply via email to