@@ -44,8 +44,11 @@ def local_test_setup(tmp_path: Path) -> Path:
4444
4545
4646@pytest .fixture
47- def fsspec_s3_backend (minio_service : "MinioService" , minio_default_bucket_name : str ) -> "ObjectStoreProtocol" :
47+ def fsspec_s3_backend (
48+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
49+ ) -> "ObjectStoreProtocol" :
4850 """Set up FSSpec S3 backend for testing."""
51+ _ = minio_client # Ensures bucket is created
4952 from sqlspec .storage .backends .fsspec import FSSpecBackend
5053
5154 return FSSpecBackend (
@@ -59,8 +62,11 @@ def fsspec_s3_backend(minio_service: "MinioService", minio_default_bucket_name:
5962
6063
6164@pytest .fixture
62- def obstore_s3_backend (minio_service : "MinioService" , minio_default_bucket_name : str ) -> "ObjectStoreProtocol" :
65+ def obstore_s3_backend (
66+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
67+ ) -> "ObjectStoreProtocol" :
6368 """Set up ObStore S3 backend for testing."""
69+ _ = minio_client # Ensures bucket is created
6470 from sqlspec .storage .backends .obstore import ObStoreBackend
6571
6672 s3_uri = f"s3://{ minio_default_bucket_name } "
@@ -371,8 +377,11 @@ def test_registry_path_resolution(tmp_path: Path) -> None:
371377
372378@pytest .mark .xdist_group ("storage" )
373379@pytest .mark .skipif (not FSSPEC_INSTALLED , reason = "fsspec not installed" )
374- def test_registry_s3_fsspec_resolution (minio_service : "MinioService" , minio_default_bucket_name : str ) -> None :
380+ def test_registry_s3_fsspec_resolution (
381+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
382+ ) -> None :
375383 """Test storage registry S3 resolution with FSSpec backend."""
384+ _ = minio_client # Ensures bucket is created
376385 from sqlspec .storage .backends .fsspec import FSSpecBackend
377386
378387 s3_uri = f"s3://{ minio_default_bucket_name } /registry_test/"
@@ -399,9 +408,10 @@ def test_registry_s3_fsspec_resolution(minio_service: "MinioService", minio_defa
399408
400409@pytest .mark .xdist_group ("storage" )
401410def test_registry_alias_registration (
402- minio_service : "MinioService" , minio_default_bucket_name : str , tmp_path : Path
411+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str , tmp_path : Path
403412) -> None :
404413 """Test storage registry alias registration and usage."""
414+ _ = minio_client # Ensures bucket is created
405415 from sqlspec .storage .backends .local import LocalStore
406416 from sqlspec .storage .backends .obstore import ObStoreBackend
407417
@@ -462,8 +472,11 @@ def local_backend(tmp_path: Path) -> "ObjectStoreProtocol":
462472
463473
464474@pytest .fixture
465- def fsspec_s3_backend_optional (minio_service : "MinioService" , minio_default_bucket_name : str ) -> "ObjectStoreProtocol" :
475+ def fsspec_s3_backend_optional (
476+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
477+ ) -> "ObjectStoreProtocol" :
466478 """Create FSSpec S3 backend if available."""
479+ _ = minio_client # Ensures bucket is created
467480 if not FSSPEC_INSTALLED :
468481 pytest .skip ("fsspec not installed" )
469482
@@ -481,8 +494,11 @@ def fsspec_s3_backend_optional(minio_service: "MinioService", minio_default_buck
481494
482495
483496@pytest .fixture
484- def obstore_s3_backend_optional (minio_service : "MinioService" , minio_default_bucket_name : str ) -> "ObjectStoreProtocol" :
497+ def obstore_s3_backend_optional (
498+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
499+ ) -> "ObjectStoreProtocol" :
485500 """Create ObStore S3 backend if available."""
501+ _ = minio_client # Ensures bucket is created
486502 if not OBSTORE_INSTALLED :
487503 pytest .skip ("obstore not installed" )
488504
@@ -563,8 +579,11 @@ def test_local_backend_error_handling(tmp_path: Path) -> None:
563579
564580@pytest .mark .xdist_group ("storage" )
565581@pytest .mark .skipif (not FSSPEC_INSTALLED , reason = "fsspec not installed" )
566- def test_fsspec_s3_error_handling (minio_service : "MinioService" , minio_default_bucket_name : str ) -> None :
582+ def test_fsspec_s3_error_handling (
583+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
584+ ) -> None :
567585 """Test FSSpec S3 backend error handling."""
586+ _ = minio_client # Ensures bucket is created
568587 from sqlspec .exceptions import FileNotFoundInStorageError
569588 from sqlspec .storage .backends .fsspec import FSSpecBackend
570589
@@ -655,9 +674,10 @@ def test_registry_alias_management(tmp_path: Path) -> None:
655674
656675@pytest .mark .xdist_group ("storage" )
657676def test_registry_backend_fallback_order (
658- tmp_path : Path , minio_service : "MinioService" , minio_default_bucket_name : str
677+ tmp_path : Path , minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
659678) -> None :
660679 """Test that registry follows correct backend fallback order."""
680+ _ = minio_client # Ensures bucket is created
661681 from sqlspec .storage .backends .local import LocalStore
662682 from sqlspec .storage .backends .obstore import ObStoreBackend
663683
@@ -727,8 +747,11 @@ def test_local_arrow_operations(tmp_path: Path) -> None:
727747@pytest .mark .xdist_group ("storage" )
728748@pytest .mark .skipif (not FSSPEC_INSTALLED , reason = "fsspec not installed" )
729749@pytest .mark .skipif (not PYARROW_INSTALLED , reason = "PyArrow not installed" )
730- def test_fsspec_s3_arrow_operations (minio_service : "MinioService" , minio_default_bucket_name : str ) -> None :
750+ def test_fsspec_s3_arrow_operations (
751+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
752+ ) -> None :
731753 """Test FSSpec S3 backend Arrow operations if pyarrow is available."""
754+ _ = minio_client # Ensures bucket is created
732755 from sqlspec .storage .backends .fsspec import FSSpecBackend
733756
734757 backend = FSSpecBackend .from_config ({
@@ -848,8 +871,11 @@ def test_local_metadata_operations(tmp_path: Path) -> None:
848871
849872@pytest .mark .xdist_group ("storage" )
850873@pytest .mark .skipif (not FSSPEC_INSTALLED , reason = "fsspec not installed" )
851- def test_fsspec_s3_metadata_operations (minio_service : "MinioService" , minio_default_bucket_name : str ) -> None :
874+ def test_fsspec_s3_metadata_operations (
875+ minio_service : "MinioService" , minio_client : Minio , minio_default_bucket_name : str
876+ ) -> None :
852877 """Test FSSpec S3 backend metadata operations."""
878+ _ = minio_client # Ensures bucket is created
853879 from sqlspec .storage .backends .fsspec import FSSpecBackend
854880
855881 backend = FSSpecBackend .from_config ({
0 commit comments