@@ -155,7 +155,7 @@ def test_get_pandas_df(self, mock_read_gbq):
155155 @mock .patch ("airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service" )
156156 def test_invalid_schema_update_options (self , mock_get_service ):
157157 with pytest .raises (
158- Exception ,
158+ ValueError ,
159159 match = (
160160 r"\['THIS IS NOT VALID'\] contains invalid schema update options. "
161161 r"Please only use one or more of the following options: "
@@ -172,7 +172,7 @@ def test_invalid_schema_update_options(self, mock_get_service):
172172 @mock .patch ("airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service" )
173173 def test_invalid_schema_update_and_write_disposition (self , mock_get_service ):
174174 with pytest .raises (
175- Exception ,
175+ ValueError ,
176176 match = "schema_update_options is only allowed if"
177177 " write_disposition is 'WRITE_APPEND' or 'WRITE_TRUNCATE'." ,
178178 ):
@@ -846,7 +846,7 @@ def test_update_table_schema_without_policy_tags(self, mock_update, mock_get_sch
846846 @mock .patch ("airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service" )
847847 def test_invalid_source_format (self , mock_get_service ):
848848 with pytest .raises (
849- Exception ,
849+ ValueError ,
850850 match = r"JSON is not a valid source format. Please use one of the following types: \['CSV', "
851851 r"'NEWLINE_DELIMITED_JSON', 'AVRO', 'GOOGLE_SHEETS', 'DATASTORE_BACKUP', 'PARQUET'\]" ,
852852 ):
@@ -959,7 +959,7 @@ def test_job_id_validity(self, mock_md5, test_dag_id, expected_job_id):
959959
960960class TestBigQueryTableSplitter :
961961 def test_internal_need_default_project (self ):
962- with pytest .raises (Exception , match = "INTERNAL: No default project is specified" ):
962+ with pytest .raises (ValueError , match = "INTERNAL: No default project is specified" ):
963963 split_tablename ("dataset.table" , None )
964964
965965 @pytest .mark .parametrize (
@@ -1008,7 +1008,7 @@ def test_split_tablename(self, project_expected, dataset_expected, table_expecte
10081008 )
10091009 def test_invalid_syntax (self , table_input , var_name , exception_message ):
10101010 default_project_id = "project"
1011- with pytest .raises (Exception , match = exception_message .format (table_input )):
1011+ with pytest .raises (ValueError , match = exception_message .format (table_input )):
10121012 split_tablename (table_input , default_project_id , var_name )
10131013
10141014
0 commit comments