1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- from typing import Iterator
15+ from typing import Iterator , Generator
1616
1717from google .cloud import bigquery
1818import pytest
1919import test_utils .prefixer
20+ from google .cloud import storage
2021
2122import bigframes .pandas as bpd
2223
@@ -42,11 +43,27 @@ def bigquery_client() -> bigquery.Client:
4243 return bigquery_client
4344
4445
46+ @pytest .fixture (scope = "session" )
47+ def storage_client (project_id ) -> storage .Client :
48+ return storage .Client (project = project_id )
49+
50+
4551@pytest .fixture (scope = "session" )
4652def project_id (bigquery_client : bigquery .Client ) -> str :
4753 return bigquery_client .project
4854
4955
56+ @pytest .fixture (scope = "session" )
57+ def gcs_bucket (storage_client ) -> Generator [str , None , None ]:
58+ bucket_name = "bigframes-gcs-test"
59+
60+ yield bucket_name
61+
62+ bucket = storage_client .get_bucket (bucket_name )
63+ for blob in bucket .list_blobs ():
64+ blob .delete ()
65+
66+
5067@pytest .fixture (autouse = True )
5168def reset_session () -> None :
5269 """An autouse fixture ensuring each sample runs in a fresh session.
@@ -78,11 +95,6 @@ def dataset_id_eu(bigquery_client: bigquery.Client, project_id: str) -> Iterator
7895 bigquery_client .delete_dataset (dataset , delete_contents = True , not_found_ok = True )
7996
8097
81- @pytest .fixture (scope = "session" )
82- def gcs_dst_bucket () -> str :
83- return "gs://bigframes_blob_test"
84-
85-
8698@pytest .fixture
8799def random_model_id (
88100 bigquery_client : bigquery .Client , project_id : str , dataset_id : str
0 commit comments