@@ -99,7 +99,7 @@ def test_func_2(lop):
99
99
async def foo ():
100
100
raise StopIteration
101
101
102
- with pytest .raises (RuntimeError , match = " coroutine raised StopIteration" ):
102
+ with pytest .raises (RuntimeError , match = ' coroutine raised StopIteration' ):
103
103
run_async (lop .Proxy (foo ))
104
104
105
105
@@ -275,7 +275,7 @@ async def g():
275
275
await foo
276
276
277
277
me = lop .Proxy (g )
278
- with pytest .raises (ValueError , match = " coroutine already executing" ):
278
+ with pytest .raises (ValueError , match = ' coroutine already executing' ):
279
279
me .send (None )
280
280
281
281
@@ -303,7 +303,7 @@ async def coro():
303
303
304
304
c = lop .Proxy (coro )
305
305
c .send (None )
306
- with pytest .raises (RuntimeError , match = " coroutine ignored GeneratorExit" ):
306
+ with pytest .raises (RuntimeError , match = ' coroutine ignored GeneratorExit' ):
307
307
c .close ()
308
308
309
309
@@ -498,15 +498,15 @@ def test_await_1(lop):
498
498
async def foo ():
499
499
await 1
500
500
501
- with pytest .raises (TypeError , match = " object int can.t.*await" ):
501
+ with pytest .raises (TypeError , match = ' object int can.t.*await' ):
502
502
run_async (lop .Proxy (foo ))
503
503
504
504
505
505
def test_await_2 (lop ):
506
506
async def foo ():
507
507
await []
508
508
509
- with pytest .raises (TypeError , match = " object list can.t.*await" ):
509
+ with pytest .raises (TypeError , match = ' object list can.t.*await' ):
510
510
run_async (lop .Proxy (foo ))
511
511
512
512
@@ -536,7 +536,7 @@ def __await__(self):
536
536
async def foo ():
537
537
return await lop .Proxy (Awaitable )
538
538
539
- with pytest .raises (TypeError , match = " __await__.*returned non-iterator of type" ):
539
+ with pytest .raises (TypeError , match = ' __await__.*returned non-iterator of type' ):
540
540
run_async (lop .Proxy (foo ))
541
541
542
542
@@ -644,7 +644,7 @@ def __await__(self):
644
644
async def foo ():
645
645
return await lop .Proxy (Awaitable )
646
646
647
- with pytest .raises (TypeError , match = r" __await__\(\) returned a coroutine" ):
647
+ with pytest .raises (TypeError , match = r' __await__\(\) returned a coroutine' ):
648
648
run_async (lop .Proxy (foo ))
649
649
650
650
c .close ()
@@ -658,7 +658,7 @@ def __await__(self):
658
658
async def foo ():
659
659
return await lop .Proxy (Awaitable )
660
660
661
- with pytest .raises (TypeError , match = " __await__.*returned non-iterator of type" ):
661
+ with pytest .raises (TypeError , match = ' __await__.*returned non-iterator of type' ):
662
662
run_async (lop .Proxy (foo ))
663
663
664
664
@@ -713,7 +713,7 @@ async def waiter(coro):
713
713
coro = lop .Proxy (coroutine )
714
714
coro .send (None )
715
715
716
- with pytest .raises (RuntimeError , match = " coroutine is being awaited already" ):
716
+ with pytest .raises (RuntimeError , match = ' coroutine is being awaited already' ):
717
717
waiter (coro ).send (None )
718
718
719
719
@@ -749,7 +749,7 @@ async def __aexit__(self, *args):
749
749
return True
750
750
751
751
async def foo ():
752
- async with lop .Proxy (lambda : Manager ("A" )) as a , lop .Proxy (lambda : Manager ("B" )) as b :
752
+ async with lop .Proxy (lambda : Manager ('A' )) as a , lop .Proxy (lambda : Manager ('B' )) as b :
753
753
await lop .Proxy (lambda : AsyncYieldFrom ([('managers' , a .name , b .name )]))
754
754
1 / 0
755
755
@@ -769,7 +769,7 @@ async def foo():
769
769
]
770
770
771
771
async def foo ():
772
- async with lop .Proxy (lambda : Manager ("A" )) as a , lop .Proxy (lambda : Manager ("C" )) as c :
772
+ async with lop .Proxy (lambda : Manager ('A' )) as a , lop .Proxy (lambda : Manager ('C' )) as c :
773
773
await lop .Proxy (lambda : AsyncYieldFrom ([('managers' , a .name , c .name )]))
774
774
1 / 0
775
775
@@ -857,7 +857,7 @@ async def foo():
857
857
async with lop .Proxy (CM ):
858
858
pass
859
859
860
- with pytest .raises (TypeError , match = "'async with' received an object from __aenter__ " " that does not implement __await__: int" ):
860
+ with pytest .raises (TypeError , match = "'async with' received an object from __aenter__ " ' that does not implement __await__: int' ):
861
861
# it's important that __aexit__ wasn't called
862
862
run_async (lop .Proxy (foo ))
863
863
@@ -879,7 +879,7 @@ async def foo():
879
879
try :
880
880
run_async (lop .Proxy (foo ))
881
881
except TypeError as exc :
882
- assert re .search ("'async with' received an object from __aexit__ " " that does not implement __await__: int" , exc .args [0 ])
882
+ assert re .search ("'async with' received an object from __aexit__ " ' that does not implement __await__: int' , exc .args [0 ])
883
883
assert exc .__context__ is not None
884
884
assert isinstance (exc .__context__ , ZeroDivisionError )
885
885
else :
@@ -903,7 +903,7 @@ async def foo():
903
903
async with lop .Proxy (CM ):
904
904
CNT += 1
905
905
906
- with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " " that does not implement __await__: int" ):
906
+ with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " ' that does not implement __await__: int' ):
907
907
run_async (lop .Proxy (foo ))
908
908
assert CNT == 1
909
909
@@ -915,7 +915,7 @@ async def foo():
915
915
CNT += 1
916
916
break
917
917
918
- with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " " that does not implement __await__: int" ):
918
+ with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " ' that does not implement __await__: int' ):
919
919
run_async (lop .Proxy (foo ))
920
920
assert CNT == 2
921
921
@@ -927,7 +927,7 @@ async def foo():
927
927
CNT += 1
928
928
continue
929
929
930
- with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " " that does not implement __await__: int" ):
930
+ with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " ' that does not implement __await__: int' ):
931
931
run_async (lop .Proxy (foo ))
932
932
assert CNT == 3
933
933
@@ -938,7 +938,7 @@ async def foo():
938
938
CNT += 1
939
939
return
940
940
941
- with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " " that does not implement __await__: int" ):
941
+ with pytest .raises (TypeError , match = "'async with' received an object from __aexit__ " ' that does not implement __await__: int' ):
942
942
run_async (lop .Proxy (foo ))
943
943
assert CNT == 4
944
944
@@ -1224,7 +1224,7 @@ async def main():
1224
1224
I += 1000
1225
1225
1226
1226
with warnings .catch_warnings ():
1227
- warnings .simplefilter (" error" )
1227
+ warnings .simplefilter (' error' )
1228
1228
# Test that __aiter__ that returns an asynchronous iterator
1229
1229
# directly does not throw any warnings.
1230
1230
run_async (main ())
@@ -1309,7 +1309,7 @@ async def foo():
1309
1309
1310
1310
with pytest .raises (ZeroDivisionError ):
1311
1311
with warnings .catch_warnings ():
1312
- warnings .simplefilter (" error" )
1312
+ warnings .simplefilter (' error' )
1313
1313
# Test that if __aiter__ raises an exception it propagates
1314
1314
# without any kind of warning.
1315
1315
run_async (lop .Proxy (foo ))
@@ -1622,7 +1622,7 @@ async def func():
1622
1622
aw .close ()
1623
1623
1624
1624
1625
- @pytest .mark .skipif (" sys.version_info[1] < 8" )
1625
+ @pytest .mark .skipif (' sys.version_info[1] < 8' )
1626
1626
def test_for_assign_raising_stop_async_iteration (lop ):
1627
1627
class BadTarget :
1628
1628
def __setitem__ (self , key , value ):
@@ -1662,7 +1662,7 @@ async def run_gen():
1662
1662
assert run_async (run_gen ()) == ([], 'end' )
1663
1663
1664
1664
1665
- @pytest .mark .skipif (" sys.version_info[1] < 8" )
1665
+ @pytest .mark .skipif (' sys.version_info[1] < 8' )
1666
1666
def test_for_assign_raising_stop_async_iteration_2 (lop ):
1667
1667
class BadIterable :
1668
1668
def __iter__ (self ):
0 commit comments