You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by tv...@apache.org on 2023/11/13 23:58:45 UTC

(beam) branch master updated: Fix the test 'test_user_agent_passed' without skipping it (#29422)

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

tvalentyn 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 7fabc1267a0 Fix the test 'test_user_agent_passed' without skipping it (#29422)
7fabc1267a0 is described below

commit 7fabc1267a0b174cb117320dd375447402797e0c
Author: Shunping Huang <sh...@google.com>
AuthorDate: Mon Nov 13 18:58:38 2023 -0500

    Fix the test 'test_user_agent_passed' without skipping it (#29422)
---
 sdks/python/apache_beam/io/gcp/bigquery_tools_test.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 b4c84d589c0..0383db7925f 100644
--- a/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
+++ b/sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
@@ -263,8 +263,14 @@ class TestBigQueryWrapper(unittest.TestCase):
       wrapper.create_temporary_dataset('project-id', 'location')
     self.assertTrue(client.datasets.Get.called)
 
+  @mock.patch(
+      'apache_beam.io.gcp.bigquery_tools.gcp_bigquery',
+      return_value=mock.Mock())
+  @mock.patch(
+      'apitools.base.py.base_api._SkipGetCredentials', return_value=True)
   @mock.patch('time.sleep', return_value=None)
-  def test_user_agent_passed(self, sleep_mock):
+  def test_user_agent_passed(
+      self, sleep_mock, skip_get_credentials_mock, gcp_bigquery_mock):
     try:
       wrapper = beam.io.gcp.bigquery_tools.BigQueryWrapper()
     except:  # pylint: disable=bare-except