Source code for django_sorcery.pytest_plugin
"""pytest plugins."""
import pytest
from .db.profiler import SQLAlchemyProfiler
from .testing import Transact
[docs]@pytest.fixture(scope="function")
def sqlalchemy_profiler():
"""pytest fixture for sqlalchemy profiler."""
with SQLAlchemyProfiler() as profiler: # pragma: nocover
yield profiler
[docs]@pytest.fixture(scope="function")
def transact():
"""pytest transact fixture for sqlalchemy."""
with Transact() as t:
yield t