use shared fixture for preprocessed alpaca dataset

This commit is contained in:
Wing Lian
2025-07-06 11:44:31 -04:00
parent a5946ff1f0
commit c40da3b5eb
2 changed files with 262 additions and 282 deletions

View File

@@ -423,6 +423,15 @@ def temp_dir() -> Generator[str, None, None]:
shutil.rmtree(_temp_dir)
@pytest.fixture(scope="module")
def module_temp_dir() -> Generator[str, None, None]:
# Create a temporary directory
_temp_dir = tempfile.mkdtemp()
yield _temp_dir
# Clean up the directory after the test
shutil.rmtree(_temp_dir)
@pytest.fixture(scope="function", autouse=True)
def unique_triton_cache_dir(temp_dir: str | PosixPath) -> None:
os.environ["TRITON_CACHE_DIR"] = str(temp_dir) + "/.triton/cache"