refiners/tests/foundationals/segment_anything/conftest.py

17 lines
345 B
Python
Raw Normal View History

2024-06-24 14:27:30 +00:00
import gc
2024-03-21 13:59:36 +00:00
from pathlib import Path
2024-10-09 09:28:34 +00:00
from pytest import fixture
2024-03-21 13:59:36 +00:00
2024-06-24 14:27:30 +00:00
@fixture(autouse=True)
def ensure_gc():
# Avoid GPU OOMs
# See https://github.com/pytest-dev/pytest/discussions/8153#discussioncomment-214812
gc.collect()
2024-03-21 13:59:36 +00:00
@fixture(scope="package")
def ref_path(test_sam_path: Path) -> Path:
return test_sam_path / "test_sam_ref"