summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2017-02-23 17:48:17 (GMT)
committerGitHub <noreply@github.com>2017-02-23 17:48:17 (GMT)
commit4c78c527d215c37472145152cb0e95f196cdddc9 (patch)
treed35b832dec5db996f48e1ef9c40ae987c9fd1855 /Lib/test/test_ast.py
parent561ca80cffd37445bac82ff820b8f52b98c50517 (diff)
downloadcpython-4c78c527d215c37472145152cb0e95f196cdddc9.zip
cpython-4c78c527d215c37472145152cb0e95f196cdddc9.tar.gz
cpython-4c78c527d215c37472145152cb0e95f196cdddc9.tar.bz2
bpo-29622: Make AST constructor to accept less than enough number of positional arguments (GH-249)
bpo-29463 added optional "docstring" field to 4 AST types. While it is optional, it breaks backward compatibility because AST constructor requires number of positional argument is same to number of fields. AST types accepts empty arguments, and incomplete keyword arguments. But it's not big problem because field can be filled after creation, and checked when compiling. So stop requiring complete set of fields for positional arguments too.
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index ac79989..366269f 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -373,12 +373,8 @@ class AST_Tests(unittest.TestCase):
self.assertEqual(x.right, 3)
self.assertEqual(x.lineno, 0)
- # node raises exception when not given enough arguments
- self.assertRaises(TypeError, ast.BinOp, 1, 2)
# node raises exception when given too many arguments
self.assertRaises(TypeError, ast.BinOp, 1, 2, 3, 4)
- # node raises exception when not given enough arguments
- self.assertRaises(TypeError, ast.BinOp, 1, 2, lineno=0)
# node raises exception when given too many arguments
self.assertRaises(TypeError, ast.BinOp, 1, 2, 3, 4, lineno=0)