@mock.patch('airflow.providers.google.cloud.hooks.bigquery.Client')
def test_insert_all_fail(self, mock_client):
    rows = [{'json': {'a_key': 'a_value_0'}}]
    mock_client.return_value.insert_rows.return_value = ['some', 'errors']
    with pytest.raises(AirflowException, match='insert error'):
        self.hook.insert_all(project_id=PROJECT_ID, dataset_id=DATASET_ID, table_id=TABLE_ID, rows=rows, fail_on_error=True)
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.Client')
def test_insert_all_fail(self, mock_client):
    rows = [{'json': {'a_key': 'a_value_0'}}]
    mock_client.return_value.insert_rows.return_value = ['some', 'errors']
    with pytest.raises(AirflowException, match='insert error'):
        self.hook.insert_all(project_id=PROJECT_ID, dataset_id=DATASET_ID, table_id=TABLE_ID, rows=rows, fail_on_error=True)