def test_bad_integer(self):
# issue13436: Bad error message with invalid numeric values
body = [ast.ImportFrom(module='time',
names=[ast.alias(name='sleep')],
level=None,
lineno=None, col_offset=None)]
mod = ast.Module(body)
with self.assertRaises((TypeError, ValueError)) as cm:
compile(mod, 'test', 'exec')
if support.check_impl_detail():
self.assertIn("invalid integer value: None", str(cm.exception))
评论列表
文章目录