[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6
Brett Cannon
report at bugs.python.org
Thu Feb 11 12:54:30 EST 2016
Brett Cannon added the comment:
You need to temporarily turn on warnings for it to work. For example:
with warnings.catch_warnings():
warnings.simplefilter('always')
with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"):
exec('async = 33')
Do notice I used exec() as otherwise the warning will be triggered at import instead of when the test runs.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26182>
_______________________________________
More information about the Python-bugs-list
mailing list