Skip to content

Commit

Permalink
Make test_await more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Jun 17, 2020
1 parent fc3fa70 commit 1207c2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_dunder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,12 @@ import sys
async def main():
res = await Once(await asyncio.sleep(0.1))
return res
# It looks like that https://bugs.python.org/issue38563 solves this problem,
# but we see still errors on Github actions...
# For an odd error similar to https://bugs.python.org/issue38563
if sys.platform == "win32" and sys.version_info >= (3, 8, 0):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
loop = asyncio.get_event_loop()
# get_event_loop can raise an error: https://github.com/PyO3/pyo3/pull/961#issuecomment-645238579
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
assert loop.run_until_complete(main()) is None
loop.close()
"#
Expand Down

0 comments on commit 1207c2d

Please sign in to comment.