@parameterized.expand([('create_empty_table',), ('create_empty_dataset',), ('get_dataset_tables',), ('delete_dataset',), ('create_external_table',), ('patch_table',), ('insert_all',), ('update_dataset',), ('patch_dataset',), ('get_dataset_tables_list',), ('get_datasets_list',), ('get_dataset',), ('run_grant_dataset_view_access',), ('run_table_upsert',), ('run_table_delete',), ('get_tabledata',), ('get_schema',), ('poll_job_complete',), ('cancel_query',), ('run_with_configuration',), ('run_load',), ('run_copy',), ('run_extract',), ('run_query',)])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook')
def test_deprecation_warning(self, func_name, mock_bq_hook):
    (args, kwargs) = ([1], {'param1': 'val1'})
    new_path = re.escape(f'`airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.{func_name}`')
    message_pattern = f'This method is deprecated\.\s+Please use {new_path}'
    message_regex = re.compile(message_pattern, re.MULTILINE)
    mocked_func = getattr(mock_bq_hook, func_name)
    bq_cursor = BigQueryCursor(mock.MagicMock(), PROJECT_ID, mock_bq_hook)
    func = getattr(bq_cursor, func_name)
    with pytest.warns(DeprecationWarning, match=message_regex):
        _ = func(*args, **kwargs)
    mocked_func.assert_called_once_with(*args, **kwargs)
    assert re.search(f'.*{new_path}.*', func.__doc__)
@parameterized.expand([('create_empty_table',), ('create_empty_dataset',), ('get_dataset_tables',), ('delete_dataset',), ('create_external_table',), ('patch_table',), ('insert_all',), ('update_dataset',), ('patch_dataset',), ('get_dataset_tables_list',), ('get_datasets_list',), ('get_dataset',), ('run_grant_dataset_view_access',), ('run_table_upsert',), ('run_table_delete',), ('get_tabledata',), ('get_schema',), ('poll_job_complete',), ('cancel_query',), ('run_with_configuration',), ('run_load',), ('run_copy',), ('run_extract',), ('run_query',)])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook')
def test_deprecation_warning(self, func_name, mock_bq_hook):
    (args, kwargs) = ([1], {'param1': 'val1'})
    new_path = re.escape(f'`airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.{func_name}`')
    message_pattern = f'This method is deprecated\.\s+Please use {new_path}'
    message_regex = re.compile(message_pattern, re.MULTILINE)
    mocked_func = getattr(mock_bq_hook, func_name)
    bq_cursor = BigQueryCursor(mock.MagicMock(), PROJECT_ID, mock_bq_hook)
    func = getattr(bq_cursor, func_name)
    with pytest.warns(DeprecationWarning, match=message_regex):
        _ = func(*args, **kwargs)
    mocked_func.assert_called_once_with(*args, **kwargs)
    assert re.search(f'.*{new_path}.*', func.__doc__)