test: Consolidate API CI test runner (#29440)

Signed-off-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
-LAN-
2025-12-15 13:20:31 +08:00
committed by GitHub
parent 1e47ffb50c
commit 80c74cf725
17 changed files with 186 additions and 114 deletions

View File

@@ -21,20 +21,16 @@ class TestOpenDAL:
)
@pytest.fixture(scope="class", autouse=True)
def teardown_class(self, request):
def teardown_class(self):
"""Clean up after all tests in the class."""
def cleanup():
folder = Path(get_opendal_bucket())
if folder.exists() and folder.is_dir():
for item in folder.iterdir():
if item.is_file():
item.unlink()
elif item.is_dir():
item.rmdir()
folder.rmdir()
yield
return cleanup()
folder = Path(get_opendal_bucket())
if folder.exists() and folder.is_dir():
import shutil
shutil.rmtree(folder, ignore_errors=True)
def test_save_and_exists(self):
"""Test saving data and checking existence."""