summaryrefslogtreecommitdiff
path: root/tests/unittest_regrtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittest_regrtest.py')
-rw-r--r--tests/unittest_regrtest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unittest_regrtest.py b/tests/unittest_regrtest.py
index 17668edd..b75e3dfe 100644
--- a/tests/unittest_regrtest.py
+++ b/tests/unittest_regrtest.py
@@ -343,5 +343,16 @@ def test_ancestor_looking_up_redefined_function():
assert isinstance(found[0], nodes.FunctionDef)
+def test_crash_in_dunder_inference_prevented():
+ code = """
+ class MyClass():
+ def fu(self, objects):
+ delitem = dict.__delitem__.__get__(self, dict)
+ delitem #@
+ """
+ inferred = next(extract_node(code).infer())
+ assert "builtins.dict.__delitem__" == inferred.qname()
+
+
if __name__ == "__main__":
unittest.main()