summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
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())