bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)

int(), bool(), float(), list() and tuple().  Specify the value as a
positional argument instead.
This commit is contained in:
Serhiy Storchaka 2017-03-06 00:53:39 +02:00 committed by GitHub
parent d31b28e16a
commit 58d23e6806
12 changed files with 65 additions and 2 deletions

View file

@ -170,6 +170,10 @@ class BoolTest(unittest.TestCase):
self.assertIs(bool(""), False)
self.assertIs(bool(), False)
def test_keyword_args(self):
with self.assertWarns(DeprecationWarning):
self.assertIs(bool(x=10), True)
def test_format(self):
self.assertEqual("%d" % False, "0")
self.assertEqual("%d" % True, "1")