88from unittest .mock import ANY , MagicMock
99
1010import aiohttp
11+ import pytest
1112from aioresponses import CallbackResult , aioresponses
1213from yarl import URL
1314
@@ -58,6 +59,7 @@ def callback(url, **kwargs):
5859 "python 3.7 doesn't have IsolatedAsyncioTestCase" ,
5960)
6061class TestAsyncify (getattr (unittest , "IsolatedAsyncioTestCase" , object )):
62+ @pytest .mark .asyncio
6163 @aioresponses ()
6264 async def test_get (self , mocked ):
6365 callback , mock = get_callback ()
@@ -72,6 +74,7 @@ async def test_get(self, mocked):
7274 timeout = ANY ,
7375 )
7476
77+ @pytest .mark .asyncio
7578 @aioresponses ()
7679 async def test_post (self , mocked ):
7780 callback , mock = get_callback ()
@@ -87,6 +90,7 @@ async def test_post(self, mocked):
8790 timeout = ANY ,
8891 )
8992
93+ @pytest .mark .asyncio
9094 @aioresponses ()
9195 async def test_post_auth (self , mocked ):
9296 callback , mock = get_callback ()
@@ -112,6 +116,7 @@ async def test_post_auth(self, mocked):
112116 timeout = ANY ,
113117 )
114118
119+ @pytest .mark .asyncio
115120 @aioresponses ()
116121 async def test_user_info (self , mocked ):
117122 callback , mock = get_callback ()
@@ -128,6 +133,7 @@ async def test_user_info(self, mocked):
128133 params = None ,
129134 )
130135
136+ @pytest .mark .asyncio
131137 @aioresponses ()
132138 async def test_file_post (self , mocked ):
133139 callback , mock = get_callback ()
@@ -152,6 +158,7 @@ async def test_file_post(self, mocked):
152158 )
153159 users .close ()
154160
161+ @pytest .mark .asyncio
155162 @aioresponses ()
156163 async def test_patch (self , mocked ):
157164 callback , mock = get_callback ()
@@ -167,6 +174,7 @@ async def test_patch(self, mocked):
167174 timeout = ANY ,
168175 )
169176
177+ @pytest .mark .asyncio
170178 @aioresponses ()
171179 async def test_put (self , mocked ):
172180 callback , mock = get_callback ()
@@ -182,6 +190,7 @@ async def test_put(self, mocked):
182190 timeout = ANY ,
183191 )
184192
193+ @pytest .mark .asyncio
185194 @aioresponses ()
186195 async def test_delete (self , mocked ):
187196 callback , mock = get_callback ()
@@ -197,6 +206,7 @@ async def test_delete(self, mocked):
197206 timeout = ANY ,
198207 )
199208
209+ @pytest .mark .asyncio
200210 @aioresponses ()
201211 async def test_shared_session (self , mocked ):
202212 callback , mock = get_callback ()
@@ -211,6 +221,7 @@ async def test_shared_session(self, mocked):
211221 timeout = ANY ,
212222 )
213223
224+ @pytest .mark .asyncio
214225 @aioresponses ()
215226 async def test_rate_limit (self , mocked ):
216227 callback , mock = get_callback (status = 429 )
@@ -226,6 +237,7 @@ async def test_rate_limit(self, mocked):
226237 (a , b , c ) = rest_client ._metrics ["backoff" ]
227238 self .assertTrue (100 <= a < b < c <= 1000 )
228239
240+ @pytest .mark .asyncio
229241 @aioresponses ()
230242 async def test_timeout (self , mocked ):
231243 callback , mock = get_callback ()
0 commit comments