mirror of
https://gitlab.com/iscmt/homehub4000-prometheus-exporter.git
synced 2026-04-04 09:22:24 -04:00
17 lines
375 B
Python
17 lines
375 B
Python
import tempfile
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from database import VirginMonitorDatabase
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_db():
|
|
"""Create a temporary database for testing."""
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as f:
|
|
db_path = f.name
|
|
db = VirginMonitorDatabase(db_path)
|
|
yield db
|
|
Path(db_path).unlink(missing_ok=True)
|