Skip to content

Commit

Permalink
Fix the test 'test_user_agent_passed' without skipping it (#29422)
Browse files Browse the repository at this point in the history
  • Loading branch information
shunping authored Nov 13, 2023
1 parent b6b1902 commit 7fabc12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdks/python/apache_beam/io/gcp/bigquery_tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,14 @@ def test_temporary_dataset_is_unique(self, patched_time_sleep):
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
Expand Down

0 comments on commit 7fabc12

Please sign in to comment.