summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Hall <alex.mojaki@gmail.com>2019-10-18 18:44:02 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2019-10-18 19:35:16 +0200
commitb2da4b04e20b7e66e946dc63e0a0c5988f736642 (patch)
treecf050bdffe8f8a3b12176aa0ccdcb8a36e50710b /tests
parent9d2d6ee0988ff009fd6dee9a02958588a8994cfe (diff)
downloadastroid-git-b2da4b04e20b7e66e946dc63e0a0c5988f736642.tar.gz
Fix as_string for attribute nodes with integer values
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest_nodes.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittest_nodes.py b/tests/unittest_nodes.py
index 3d785c0f..fafd063d 100644
--- a/tests/unittest_nodes.py
+++ b/tests/unittest_nodes.py
@@ -200,6 +200,14 @@ if all[1] == bord[0:]:
ast = abuilder.string_build(code)
self.assertEqual(ast.as_string(), code)
+ def test_int_attribute(self):
+ code = """
+x = (-3).real
+y = (3).imag
+ """
+ ast = abuilder.string_build(code)
+ self.assertEqual(ast.as_string().strip(), code.strip())
+
def test_operator_precedence(self):
with open(resources.find("data/operator_precedence.py")) as f:
for code in f: