@@ -77,10 +77,14 @@ def dummy_return_question_detail_dict(
77
77
@mock .patch ("os.environ" , mock .MagicMock (return_value = {"LEETCODE_SESSION_ID" : "test" }))
78
78
@mock .patch ("leetcode.auth" , mock .MagicMock ())
79
79
class TestLeetcode :
80
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
81
+ # `pytest.mark.asyncio`.
80
82
@pytest .mark .asyncio
81
83
async def test_get_leetcode_api_client (self ) -> None :
82
84
assert leetcode_anki .helpers .leetcode ._get_leetcode_api_client ()
83
85
86
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
87
+ # `pytest.mark.asyncio`.
84
88
@pytest .mark .asyncio
85
89
async def test_retry (self ) -> None :
86
90
decorator = leetcode_anki .helpers .leetcode .retry (
@@ -134,6 +138,8 @@ def setup(self) -> None:
134
138
0 , 10000
135
139
)
136
140
141
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
142
+ # `pytest.mark.asyncio`.
137
143
@pytest .mark .asyncio
138
144
@mock .patch (
139
145
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -142,6 +148,8 @@ def setup(self) -> None:
142
148
async def test_init (self ) -> None :
143
149
self ._leetcode_data ._cache ["test" ] = QUESTION_DETAIL
144
150
151
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
152
+ # `pytest.mark.asyncio`.
145
153
@pytest .mark .asyncio
146
154
@mock .patch (
147
155
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -151,6 +159,8 @@ async def test_get_description(self) -> None:
151
159
self ._leetcode_data ._cache ["test" ] = QUESTION_DETAIL
152
160
assert (await self ._leetcode_data .description ("test" )) == "test content"
153
161
162
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
163
+ # `pytest.mark.asyncio`.
154
164
@pytest .mark .asyncio
155
165
@mock .patch (
156
166
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -162,6 +172,8 @@ async def test_submissions(self) -> None:
162
172
assert (await self ._leetcode_data .submissions_total ("test" )) == 1
163
173
assert (await self ._leetcode_data .submissions_accepted ("test" )) == 1
164
174
175
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
176
+ # `pytest.mark.asyncio`.
165
177
@pytest .mark .asyncio
166
178
@mock .patch (
167
179
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -173,6 +185,8 @@ async def test_difficulty_easy(self) -> None:
173
185
QUESTION_DETAIL .difficulty = "Easy"
174
186
assert "Easy" in (await self ._leetcode_data .difficulty ("test" ))
175
187
188
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
189
+ # `pytest.mark.asyncio`.
176
190
@pytest .mark .asyncio
177
191
@mock .patch (
178
192
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -184,6 +198,8 @@ async def test_difficulty_medium(self) -> None:
184
198
QUESTION_DETAIL .difficulty = "Medium"
185
199
assert "Medium" in (await self ._leetcode_data .difficulty ("test" ))
186
200
201
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
202
+ # `pytest.mark.asyncio`.
187
203
@pytest .mark .asyncio
188
204
@mock .patch (
189
205
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -195,6 +211,8 @@ async def test_difficulty_hard(self) -> None:
195
211
QUESTION_DETAIL .difficulty = "Hard"
196
212
assert "Hard" in (await self ._leetcode_data .difficulty ("test" ))
197
213
214
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
215
+ # `pytest.mark.asyncio`.
198
216
@pytest .mark .asyncio
199
217
@mock .patch (
200
218
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -205,6 +223,8 @@ async def test_paid(self) -> None:
205
223
206
224
assert (await self ._leetcode_data .paid ("test" )) is False
207
225
226
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
227
+ # `pytest.mark.asyncio`.
208
228
@pytest .mark .asyncio
209
229
@mock .patch (
210
230
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -215,6 +235,8 @@ async def test_problem_id(self) -> None:
215
235
216
236
assert (await self ._leetcode_data .problem_id ("test" )) == "1"
217
237
238
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
239
+ # `pytest.mark.asyncio`.
218
240
@pytest .mark .asyncio
219
241
@mock .patch (
220
242
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -225,6 +247,8 @@ async def test_likes(self) -> None:
225
247
226
248
assert (await self ._leetcode_data .likes ("test" )) == 1
227
249
250
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
251
+ # `pytest.mark.asyncio`.
228
252
@pytest .mark .asyncio
229
253
@mock .patch (
230
254
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -235,6 +259,8 @@ async def test_dislikes(self) -> None:
235
259
236
260
assert (await self ._leetcode_data .dislikes ("test" )) == 1
237
261
262
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
263
+ # `pytest.mark.asyncio`.
238
264
@pytest .mark .asyncio
239
265
@mock .patch (
240
266
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -248,6 +274,8 @@ async def test_tags(self) -> None:
248
274
"difficulty-hard-tag" ,
249
275
]
250
276
277
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
278
+ # `pytest.mark.asyncio`.
251
279
@pytest .mark .asyncio
252
280
@mock .patch (
253
281
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -258,6 +286,8 @@ async def test_freq_bar(self) -> None:
258
286
259
287
assert (await self ._leetcode_data .freq_bar ("test" )) == 1.1
260
288
289
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
290
+ # `pytest.mark.asyncio`.
261
291
@pytest .mark .asyncio
262
292
@mock .patch (
263
293
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data" ,
@@ -267,6 +297,8 @@ async def test_get_problem_data(self) -> None:
267
297
assert self ._leetcode_data ._cache ["test" ] == QUESTION_DETAIL
268
298
269
299
@mock .patch ("time.sleep" , mock .Mock ())
300
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
301
+ # `pytest.mark.asyncio`.
270
302
@pytest .mark .asyncio
271
303
async def test_get_problems_data_page (self ) -> None :
272
304
data = leetcode .models .graphql_data .GraphqlData (
@@ -281,14 +313,20 @@ async def test_get_problems_data_page(self) -> None:
281
313
QUESTION_DETAIL
282
314
]
283
315
316
+ # pyre-fixme[56]: Pyre was not able to infer the type of the decorator
317
+ # `pytest.mark.asyncio`.
284
318
@pytest .mark .asyncio
285
319
@mock .patch (
286
320
"leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_count" ,
287
321
mock .Mock (return_value = 234 ),
288
322
)
289
323
@mock .patch ("leetcode_anki.helpers.leetcode.LeetcodeData._get_problems_data_page" )
290
- async def test_get_problems_data (self , mock_get_problems_data_page ) -> None :
291
- question_list = [QUESTION_DETAIL ] * 234
324
+ async def test_get_problems_data (
325
+ self , mock_get_problems_data_page : mock .Mock
326
+ ) -> None :
327
+ question_list : List [
328
+ leetcode .models .graphql_question_detail .GraphqlQuestionDetail
329
+ ] = [QUESTION_DETAIL ] * 234
292
330
293
331
def dummy (
294
332
offset : int , page_size : int , page : int
0 commit comments