summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorDmitry Pribysh <dmand@yandex.ru>2015-10-21 16:07:05 +0300
committerDmitry Pribysh <dmand@yandex.ru>2015-10-21 16:07:05 +0300
commitfba7aa120b77390edb189a9316d5fb4556886f61 (patch)
tree0106ce4438a5b0cfe9bb47451f9df04b939020df /astroid
parent39601d81ccf045b6586707404aff20cf4d2ae5ac (diff)
downloadastroid-fba7aa120b77390edb189a9316d5fb4556886f61.tar.gz
Add unit test that crashes inference with 'maximum call depth exceeded' error.
Diffstat (limited to 'astroid')
-rw-r--r--astroid/tests/unittest_inference.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py
index 6756838..cd27962 100644
--- a/astroid/tests/unittest_inference.py
+++ b/astroid/tests/unittest_inference.py
@@ -1018,6 +1018,18 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
self.assertEqual(len(inferred), 1)
self.assertEqual(inferred[0], util.YES)
+ def test_binary_op_on_self(self):
+ 'test correct handling of applying binary operator to self'
+ code = '''
+ import sys
+ sys.path = ['foo'] + sys.path
+ sys.path.insert(0, 'bar')
+ path = sys.path
+ '''
+ ast = parse(code, __name__)
+ inferred = ast['path'].inferred()
+ self.assertIsInstance(inferred[0], nodes.List)
+
def test_binary_op_tuple_add(self):
ast = builder.string_build('a = (1,) + (2,)', __name__, __file__)
inferred = list(ast['a'].infer())