summaryrefslogtreecommitdiff
path: root/astroid/tests
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-06-09 23:37:30 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-06-09 23:37:30 +0300
commit696652182cc5452e21feb413e560d78011f21545 (patch)
tree3e1e5e0e8a39471010a46fb40f9b242697f7fee4 /astroid/tests
parentc2d4721d5f2f98f748ade35664530fa050ba5f62 (diff)
downloadastroid-696652182cc5452e21feb413e560d78011f21545.tar.gz
Don't leak StopIteration when inferring invalid UnaryOps.
Diffstat (limited to 'astroid/tests')
-rw-r--r--astroid/tests/unittest_inference.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/tests/unittest_inference.py b/astroid/tests/unittest_inference.py
index c80c8eb..3548d67 100644
--- a/astroid/tests/unittest_inference.py
+++ b/astroid/tests/unittest_inference.py
@@ -1849,6 +1849,10 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
self.assertRaises(InferenceError, next, module['other_decorators'].infer())
self.assertRaises(InferenceError, next, module['no_yield'].infer())
+ def test_unary_op_leaks_stop_iteration(self):
+ node = test_utils.extract_node('+[] #@')
+ self.assertRaises(InferenceError, next, node.infer())
+
class GetattrTest(unittest.TestCase):