8000 bpo-33562: Check for asyncio global setting changes in tests by brettcannon · Pull Request #6958 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-33562: Check for asyncio global setting changes in tests #6958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make test_asyncgen not wipe out the global event loop
  • Loading branch information
brettcannon committed May 17, 2018
commit a00094cb8ec3e61ebd1f8f6d202711ec3ba0e8b1
4 changes: 3 additions & 1 deletion Lib/test/test_asyncgen.py
785B
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,14 @@ async def gen():
class AsyncGenAsyncioTest(unittest.TestCase):

def setUp(self):
self.old_loop = asyncio.get_event_loop()
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(None)

def tearDown(self):
self.loop.close()
self.loop = None
asyncio.set_event_loop(self.old_loop)
self.old_loop = self.loop = None

async def to_list(self, gen):
res = []
Expand Down
0