Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
d2ef66a1
Unverified
Commit
d2ef66a1
authored
2 years ago
by
Kumar Aditya
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GH-89369: test_contextlib_async finalizes event loop after each test (#93074)
Use asyncio.run().
parent
37c9a351
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Lib/test/test_contextlib_async.py
+4
-7
4 additions, 7 deletions
Lib/test/test_contextlib_async.py
with
4 additions
and
7 deletions
Lib/test/test_contextlib_async.py
+
4
−
7
View file @
d2ef66a1
...
...
@@ -15,15 +15,12 @@ def _async_test(func):
@functools.wraps
(
func
)
def
wrapper
(
*
args
,
**
kwargs
):
coro
=
func
(
*
args
,
**
kwargs
)
loop
=
asyncio
.
new_event_loop
()
asyncio
.
set_event_loop
(
loop
)
try
:
return
loop
.
run_until_complete
(
coro
)
finally
:
loop
.
close
()
asyncio
.
set_event_loop_policy
(
None
)
asyncio
.
run
(
coro
)
return
wrapper
def
tearDownModule
():
asyncio
.
set_event_loop_policy
(
None
)
class
TestAbstractAsyncContextManager
(
unittest
.
TestCase
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment