Skip to content

Commit bfa952d

Browse files
committed
patching test directory to run pytest from uv
1 parent f84f7e9 commit bfa952d

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import factory
66
import pytest
77
import pytest_asyncio
8-
from models import MockModel, MockRelatedModel
98
from sqlalchemy import Engine, create_engine
109
from sqlalchemy.ext.asyncio import (
1110
AsyncEngine,
@@ -20,6 +19,8 @@
2019
AsyncSession as SQLModelAsyncSession, # Import SQLModel AsyncSession
2120
)
2221

22+
from .models import MockModel, MockRelatedModel
23+
2324
# Define types if you haven't already, using the SQLModel versions
2425
SyncSessionType = SQLModelSession
2526
AsyncSessionType = SQLModelAsyncSession

tests/test_async_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
from unittest.mock import AsyncMock, MagicMock, call, patch
66

77
import pytest
8-
from conftest import MockModelFactory, MockRelatedModelFactory
9-
from models import ( # Assuming MockRelatedModel is needed for relationship
10-
MockModel,
11-
)
128
from sqlmodel import ( # Import Relationship if needed for model definition
139
select,
1410
)
@@ -35,6 +31,11 @@
3531
from sqlmodel_crud_utils.a_sync import update_row as async_update_row
3632
from sqlmodel_crud_utils.a_sync import write_row as async_write_row
3733

34+
from .conftest import MockModelFactory, MockRelatedModelFactory
35+
from .models import ( # Assuming MockRelatedModel is needed for relationship
36+
MockModel,
37+
)
38+
3839
# --- Tests for get_result_from_query ---
3940
# (No changes needed for these tests - they use real sessions)
4041

tests/test_sync_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from unittest.mock import MagicMock, call, patch
66

7-
from conftest import MockModelFactory, MockRelatedModelFactory
8-
from models import MockModel
97
from sqlmodel import Session, select # Keep Session for type hints
108

119
from sqlmodel_crud_utils.sync import (
@@ -25,6 +23,9 @@
2523
from sqlmodel_crud_utils.sync import update_row as sync_update_row
2624
from sqlmodel_crud_utils.sync import write_row as sync_write_row
2725

26+
from .conftest import MockModelFactory, MockRelatedModelFactory
27+
from .models import MockModel
28+
2829
# --- Tests for get_result_from_query ---
2930
# (No changes needed - use real sessions)
3031

0 commit comments

Comments
 (0)