@@ -55,7 +55,6 @@ async def async_multiplied(self, ait):
55
55
await yield_ (value * self ._factor )
56
56
57
57
58
- @pytest .mark .asyncio
59
58
async def test_async_generator ():
60
59
assert await collect (async_range (10 )) == list (range (10 ))
61
60
assert (await collect (double (async_range (5 ))) == [0 , 2 , 4 , 6 , 8 ])
@@ -72,7 +71,6 @@ async def agen_yield_no_arg():
72
71
await yield_ ()
73
72
74
73
75
- @pytest .mark .asyncio
76
74
async def test_yield_no_arg ():
77
75
assert await collect (agen_yield_no_arg ()) == [None ]
78
76
@@ -91,7 +89,6 @@ async def async_gen_with_non_None_return():
91
89
return "hi"
92
90
93
91
94
- @pytest .mark .asyncio
95
92
async def test_bad_return_value ():
96
93
gen = async_gen_with_non_None_return ()
97
94
async for item in gen : # pragma: no branch
@@ -181,7 +178,6 @@ def test_yield_different_entries():
181
178
assert yielded == [1 , 2 , 3 , 4 ]
182
179
183
180
184
- @pytest .mark .asyncio
185
181
async def test_reentrance_forbidden ():
186
182
@async_generator
187
183
async def recurse ():
@@ -195,7 +191,6 @@ async def recurse():
195
191
196
192
197
193
# https://bugs.python.org/issue32526
198
- @pytest .mark .asyncio
199
194
async def test_reentrance_forbidden_while_suspended_in_coroutine_runner ():
200
195
@async_generator
201
196
async def f ():
@@ -226,7 +221,6 @@ async def asend_me():
226
221
assert (await yield_ (3 )) == 4
227
222
228
223
229
- @pytest .mark .asyncio
230
224
async def test_asend ():
231
225
aiter = asend_me ()
232
226
assert (await aiter .__anext__ ()) == 1
@@ -251,7 +245,6 @@ async def athrow_me():
251
245
await yield_ (3 )
252
246
253
247
254
- @pytest .mark .asyncio
255
248
async def test_athrow ():
256
249
aiter = athrow_me ()
257
250
assert (await aiter .__anext__ ()) == 1
@@ -279,7 +272,6 @@ async def close_me_aiter(track):
279
272
track [0 ] = "wtf"
280
273
281
274
282
- @pytest .mark .asyncio
283
275
async def test_aclose ():
284
276
track = [None ]
285
277
aiter = close_me_aiter (track )
@@ -291,15 +283,13 @@ async def test_aclose():
291
283
assert track [0 ] == "closed"
292
284
293
285
294
- @pytest .mark .asyncio
295
286
async def test_aclose_on_unstarted_generator ():
296
287
aiter = close_me_aiter ([None ])
297
288
await aiter .aclose ()
298
289
async for obj in aiter :
299
290
assert False # pragma: no cover
300
291
301
292
302
- @pytest .mark .asyncio
303
293
async def test_aclose_on_finished_generator ():
304
294
aiter = async_range (3 )
305
295
async for obj in aiter :
@@ -323,7 +313,6 @@ async def async_yield_during_aclose():
323
313
await yield_ (2 )
324
314
325
315
326
- @pytest .mark .asyncio
327
316
async def test_aclose_yielding ():
328
317
aiter = sync_yield_during_aclose ()
329
318
assert (await aiter .__anext__ ()) == 1
@@ -368,7 +357,6 @@ async def native_async_range(count):
368
357
)
369
358
370
359
371
- @pytest .mark .asyncio
372
360
async def test_async_yield_from_ ():
373
361
assert await collect (async_range_twice (3 )) == [
374
362
0 ,
@@ -406,7 +394,6 @@ async def wraps_doubles_sends(value):
406
394
await yield_from_ (doubles_sends (value ))
407
395
408
396
409
- @pytest .mark .asyncio
410
397
async def test_async_yield_from_asend ():
411
398
gen = wraps_doubles_sends (10 )
412
399
await gen .__anext__ () == 20
@@ -416,7 +403,6 @@ async def test_async_yield_from_asend():
416
403
await gen .aclose ()
417
404
418
405
419
- @pytest .mark .asyncio
420
406
async def test_async_yield_from_athrow ():
421
407
gen = async_range_twice (2 )
422
408
assert (await gen .__anext__ ()) == 0
@@ -435,13 +421,11 @@ async def yields_from_returns_1():
435
421
await yield_ (await yield_from_ (returns_1 ()))
436
422
437
423
438
- @pytest .mark .asyncio
439
424
async def test_async_yield_from_return_value ():
440
425
assert await collect (yields_from_returns_1 ()) == [0 , 1 ]
441
426
442
427
443
428
# Special cases to get coverage
444
- @pytest .mark .asyncio
445
429
async def test_yield_from_empty ():
446
430
@async_generator
447
431
async def empty ():
@@ -454,7 +438,6 @@ async def yield_from_empty():
454
438
assert await collect (yield_from_empty ()) == []
455
439
456
440
457
- @pytest .mark .asyncio
458
441
async def test_yield_from_non_generator ():
459
442
class Countdown :
460
443
def __init__ (self , count ):
@@ -524,7 +507,6 @@ async def yield_from_countdown(count, happenings):
524
507
assert h == ["countdown closed" , "raise" ]
525
508
526
509
527
- @pytest .mark .asyncio
528
510
async def test_yield_from_non_generator_with_no_aclose ():
529
511
class Countdown :
530
512
def __init__ (self , count ):
@@ -559,7 +541,6 @@ async def yield_from_countdown(count):
559
541
await agen .aclose ()
560
542
561
543
562
- @pytest .mark .asyncio
563
544
async def test_yield_from_with_old_style_aiter ():
564
545
# old-style 'async def __aiter__' should still work even on newer pythons
565
546
class Countdown :
@@ -584,7 +565,6 @@ async def yield_from_countdown(count):
584
565
assert await collect (yield_from_countdown (3 )) == [2 , 1 , 0 ]
585
566
586
567
587
- @pytest .mark .asyncio
588
568
async def test_yield_from_athrow_raises_StopAsyncIteration ():
589
569
@async_generator
590
570
async def catch ():
@@ -615,7 +595,6 @@ async def yield_from_catch():
615
595
################################################################
616
596
617
597
618
- @pytest .mark .asyncio
619
598
async def test___del__ ():
620
599
gen = async_range (10 )
621
600
# Hasn't started yet, so no problem
@@ -699,7 +678,6 @@ def test_collections_abc_AsyncGenerator():
699
678
assert isinstance (async_range (10 ), collections .abc .AsyncGenerator )
700
679
701
680
702
- @pytest .mark .asyncio
703
681
async def test_ag_attributes ():
704
682
@async_generator
705
683
async def f ():
@@ -767,7 +745,6 @@ async def lets_exception_out():
767
745
await yield_ ()
768
746
769
747
770
- @pytest .mark .asyncio
771
748
async def test_throw_StopIteration_or_StopAsyncIteration ():
772
749
for cls in [StopIteration , StopAsyncIteration ]:
773
750
agen = lets_exception_out ()
@@ -781,7 +758,6 @@ async def test_throw_StopIteration_or_StopAsyncIteration():
781
758
782
759
# No "coroutine was never awaited" warnings for async generators that are not
783
760
# iterated
784
- @pytest .mark .asyncio
785
761
async def test_no_spurious_unawaited_coroutine_warning (recwarn ):
786
762
agen = async_range (10 )
787
763
del agen
0 commit comments