def METHOD_NAME(self) -> None:
    ast_node = builder.extract_node(
        """
    class A(type):
        def test(cls):
            return cls
    class C:
        pass
    import six
    class B(six.with_metaclass(A, C)):
        pass
    B #@
    """
    )
    inferred = next(ast_node.infer())
    self.assertIsInstance(inferred, nodes.ClassDef)
    self.assertEqual(inferred.name, "B")
    self.assertIsInstance(inferred.bases[0], nodes.Call)
    ancestors = tuple(inferred.ancestors())
    self.assertIsInstance(ancestors[0], nodes.ClassDef)
    self.assertEqual(ancestors[0].name, "C")
    self.assertIsInstance(ancestors[1], nodes.ClassDef)
    self.assertEqual(ancestors[1].name, "object")