Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
e5713e24
Commit
e5713e24
authored
Mar 30, 2021
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.29.x'
parents
112e6e0b
5fd6f07e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
41 deletions
+51
-41
CHANGES.rst
CHANGES.rst
+10
-0
tests/run/test_asyncgen.py
tests/run/test_asyncgen.py
+41
-41
No files found.
CHANGES.rst
View file @
e5713e24
...
...
@@ -532,6 +532,16 @@ Other changes
*
Support
for
Python
2.6
was
removed
.
0.29.23
(
2021
-??-??)
====================
Bugs
fixed
----------
*
Some
problems
with
Python
3.10
were
resolved
.
Patches
by
Victor
Stinner
and
David
Woods
.
(
Github
issue
#
4046
)
0.29.22
(
2021
-
02
-
20
)
====================
...
...
tests/run/test_asyncgen.py
View file @
e5713e24
...
...
@@ -534,9 +534,9 @@ class AsyncGenAsyncioTest(unittest.TestCase):
def
test_async_gen_asyncio_01
(
self
):
async
def
gen
():
yield
1
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
2
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
return
yield
3
...
...
@@ -546,7 +546,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
def
test_async_gen_asyncio_02
(
self
):
async
def
gen
():
yield
1
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
2
1
/
ZERO
yield
3
...
...
@@ -560,7 +560,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
class
Gen
:
async
def
__aiter__
(
self
):
yield
1
await
asyncio
.
sleep
(
0.01
,
loop
=
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
2
res
=
loop
.
run_until_complete
(
self
.
to_list
(
Gen
()))
...
...
@@ -569,13 +569,13 @@ class AsyncGenAsyncioTest(unittest.TestCase):
def
test_async_gen_asyncio_anext_04
(
self
):
async
def
foo
():
yield
1
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
try
:
yield
2
yield
3
except
ZeroDivisionError
:
yield
1000
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
4
async
def
run1
():
...
...
@@ -726,7 +726,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
yield
1
1
/
ZERO
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
12
async
def
run
():
...
...
@@ -749,8 +749,8 @@ class AsyncGenAsyncioTest(unittest.TestCase):
yield
1
1
/
ZERO
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
+=
1
DONE
+=
1000
...
...
@@ -776,8 +776,8 @@ class AsyncGenAsyncioTest(unittest.TestCase):
DONE
+=
1000
yield
2
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
+=
1
DONE
+=
1000
...
...
@@ -792,7 +792,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
# Silence ResourceWarnings
fut
.
cancel
()
self
.
loop
.
run_until_complete
(
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
))
self
.
loop
.
run_until_complete
(
asyncio
.
sleep
(
0.01
))
@
needs_py36_asyncio
def
test_async_gen_asyncio_gc_aclose_09
(
self
):
...
...
@@ -804,8 +804,8 @@ class AsyncGenAsyncioTest(unittest.TestCase):
while
True
:
yield
1
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
=
1
async
def
run
():
...
...
@@ -814,7 +814,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
await
g
.
__anext__
()
del
g
await
asyncio
.
sleep
(
0.2
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.2
)
self
.
loop
.
run_until_complete
(
run
())
self
.
assertEqual
(
DONE
,
1
)
...
...
@@ -932,15 +932,15 @@ class AsyncGenAsyncioTest(unittest.TestCase):
async
def
gen
():
nonlocal
DONE
try
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
v
=
yield
1
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
v
*
2
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
return
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
=
1
async
def
run
():
...
...
@@ -962,21 +962,21 @@ class AsyncGenAsyncioTest(unittest.TestCase):
DONE
=
0
async
def
sleep_n_crash
(
delay
):
await
asyncio
.
sleep
(
delay
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
delay
)
1
/
ZERO
async
def
gen
():
nonlocal
DONE
try
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
v
=
yield
1
await
sleep_n_crash
(
0.01
)
DONE
+=
1000
yield
v
*
2
finally
:
assert
sys
.
exc_info
()[
0
]
==
ZeroDivisionError
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
+=
1
async
def
run
():
...
...
@@ -995,7 +995,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
DONE
=
0
async
def
sleep_n_crash
(
delay
):
fut
=
asyncio
.
ensure_future
(
asyncio
.
sleep
(
delay
,
loop
=
self
.
loop
),
fut
=
asyncio
.
ensure_future
(
asyncio
.
sleep
(
delay
),
loop
=
self
.
loop
)
self
.
loop
.
call_later
(
delay
/
2
,
lambda
:
fut
.
cancel
())
return
await
fut
...
...
@@ -1003,14 +1003,14 @@ class AsyncGenAsyncioTest(unittest.TestCase):
async
def
gen
():
nonlocal
DONE
try
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
v
=
yield
1
await
sleep_n_crash
(
0.01
)
DONE
+=
1000
yield
v
*
2
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
=
1
async
def
run
():
...
...
@@ -1049,18 +1049,18 @@ class AsyncGenAsyncioTest(unittest.TestCase):
async
def
gen
():
nonlocal
DONE
try
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
try
:
v
=
yield
1
except
FooEr
:
v
=
1000
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
yield
v
*
2
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
# return
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
=
1
async
def
run
():
...
...
@@ -1085,7 +1085,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
pass
async
def
sleep_n_crash
(
delay
):
fut
=
asyncio
.
ensure_future
(
asyncio
.
sleep
(
delay
,
loop
=
self
.
loop
),
fut
=
asyncio
.
ensure_future
(
asyncio
.
sleep
(
delay
),
loop
=
self
.
loop
)
self
.
loop
.
call_later
(
delay
/
2
,
lambda
:
fut
.
cancel
())
return
await
fut
...
...
@@ -1093,17 +1093,17 @@ class AsyncGenAsyncioTest(unittest.TestCase):
async
def
gen
():
nonlocal
DONE
try
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
try
:
v
=
yield
1
except
FooEr
:
await
sleep_n_crash
(
0.01
)
yield
v
*
2
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
# return
finally
:
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0.01
)
await
asyncio
.
sleep
(
0.01
)
DONE
=
1
async
def
run
():
...
...
@@ -1203,10 +1203,10 @@ class AsyncGenAsyncioTest(unittest.TestCase):
async
def
waiter
(
timeout
):
nonlocal
finalized
try
:
await
asyncio
.
sleep
(
timeout
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
timeout
)
yield
1
finally
:
await
asyncio
.
sleep
(
0
,
loop
=
self
.
loop
)
await
asyncio
.
sleep
(
0
)
finalized
+=
1
async
def
wait
():
...
...
@@ -1216,7 +1216,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
t1
=
self
.
loop
.
create_task
(
wait
())
t2
=
self
.
loop
.
create_task
(
wait
())
self
.
loop
.
run_until_complete
(
asyncio
.
sleep
(
0.1
,
loop
=
self
.
loop
))
self
.
loop
.
run_until_complete
(
asyncio
.
sleep
(
0.1
))
# Silence warnings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment