From 54a7cc708998cd27371f138ac0a335d28bfb02a4 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Mon, 21 Nov 2016 11:22:43 +0200 Subject: Hardcode the names of the expected unbound method names. --- astroid/tests/unittest_object_model.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'astroid') diff --git a/astroid/tests/unittest_object_model.py b/astroid/tests/unittest_object_model.py index 573ebbba..141354f7 100644 --- a/astroid/tests/unittest_object_model.py +++ b/astroid/tests/unittest_object_model.py @@ -106,8 +106,12 @@ class UnboundMethodModelTest(unittest.TestCase): cls = next(ast_nodes[0].infer()) self.assertIsInstance(cls, astroid.ClassDef) - unbound = BUILTINS.locals[types.MethodType.__name__][0] - self.assertIs(cls, unbound) + if six.PY2: + unbound_name = 'instancemethod' + else: + unbound_name = 'function' + + self.assertEqual(cls.name, unbound_name) func = next(ast_nodes[1].infer()) self.assertIsInstance(func, astroid.FunctionDef) -- cgit v1.2.1