Skip to content

Commit a9664dd

Browse files
committed
Clean up conftest
1 parent efa2603 commit a9664dd

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

test/conftest.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from pydantic_redis import syncio as syn, asyncio as asy
1111

1212

13+
aio_pytest_fixture = getattr(pytest_asyncio, "fixture", pytest.fixture())
14+
15+
1316
class Author(syn.Model):
1417
_primary_key_field: str = "name"
1518
name: str
@@ -157,20 +160,6 @@ class AsyncLibrary(asy.Model):
157160

158161
# async fixtures
159162
async_redis_store_fixture = [(lazy_fixture("async_redis_store"))]
160-
async_books_fixture = [
161-
(lazy_fixture("async_redis_store"), book) for book in async_books
162-
]
163-
async_update_books_fixture = [
164-
(
165-
lazy_fixture("async_redis_store"),
166-
book.title,
167-
{"author": authors["jane"], "in_stock": not book.in_stock},
168-
)
169-
for book in async_books[-1:]
170-
]
171-
async_delete_books_fixture = [
172-
(lazy_fixture("async_redis_store"), book.title) for book in async_books[-1:]
173-
]
174163

175164

176165
@pytest.fixture()
@@ -206,7 +195,7 @@ def redis_store(redis_server):
206195
store.redis_store.flushall()
207196

208197

209-
@pytest_asyncio.fixture
198+
@aio_pytest_fixture
210199
async def async_redis_store(redis_server):
211200
"""Sets up a redis store using the redis_server fixture and adds the book model to it"""
212201
store = asy.Store(

0 commit comments

Comments
 (0)