def METHOD_NAME(self):
    """Top level regular assignment not allowed, raises a message."""
    src = """
    name = "George"
    """
    mod = astroid.parse(src)
    with self.assertAddsMessages(
        pylint.testutils.MessageTest(
            msg_id="forbidden-top-level-code", node=mod.body[0], args=2
        ),
        ignore_position=True,
    ):
        self.checker.visit_module(mod)