File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/sqlalchemy-bigquery/tests/system Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2323import pytest
2424import sqlalchemy
2525
26+ from google .api_core import exceptions
2627from google .cloud import bigquery
2728import test_utils .prefixer
29+ import test_utils .retry
2830
2931from sqlalchemy_bigquery import BigQueryDialect
3032
@@ -128,7 +130,10 @@ def bigquery_regional_dataset(bigquery_client, bigquery_schema):
128130@pytest .fixture (autouse = True )
129131def cleanup_extra_tables (bigquery_client , bigquery_dataset ):
130132 common = "sample" , "sample_one_row" , "sample_view" , "sample_dml_empty"
131- for table in bigquery_client .list_tables (bigquery_dataset ):
133+ # Back-end may raise 403 for a dataset not ready yet.
134+ retry_403 = test_utils .retry .RetryErrors (exceptions .Forbidden )
135+ tables = retry_403 (bigquery_client .list_tables )(bigquery_dataset )
136+ for table in tables :
132137 if table .table_id not in common :
133138 bigquery_client .delete_table (table )
134139
You can’t perform that action at this time.
0 commit comments