File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 1010from pydantic_redis import syncio as syn , asyncio as asy
1111
1212
13+ aio_pytest_fixture = getattr (pytest_asyncio , "fixture" , pytest .fixture ())
14+
15+
1316class Author (syn .Model ):
1417 _primary_key_field : str = "name"
1518 name : str
@@ -157,20 +160,6 @@ class AsyncLibrary(asy.Model):
157160
158161# async fixtures
159162async_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
210199async 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 (
You can’t perform that action at this time.
0 commit comments