bpo-31721: Allow Future._log_traceback to only be set to False (#5009)

This commit is contained in:
Yury Selivanov 2017-12-25 16:16:10 -05:00 committed by GitHub
parent 3070b71e5e
commit e0aef4f3cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 6 deletions

View file

@ -623,6 +623,15 @@ class BaseTaskTests:
t.cancel()
self.assertRaises(asyncio.CancelledError, loop.run_until_complete, t)
def test_log_traceback(self):
async def coro():
pass
task = self.new_task(self.loop, coro())
with self.assertRaisesRegex(ValueError, 'can only be set to False'):
task._log_traceback = True
self.loop.run_until_complete(task)
def test_wait_for_timeout_less_then_0_or_0_future_done(self):
def gen():
when = yield