void () { PsiElement targetElement = find().getParent().getParent(); //first parent is PyCallExpression assertTrue(targetElement instanceof PyDecorator); PyDecorator deco = (PyDecorator)targetElement; PyFunction decofun = deco.getTarget(); assertNotNull(decofun); assertEquals("foo", decofun.getName()); assertFalse(deco.isBuiltin()); assertTrue(deco.hasArgumentList()); PyArgumentList arglist = deco.getArgumentList(); assertNotNull(arglist); PyExpression[] args = arglist.getArguments(); assertEquals("argument count", 1, args.length); assertEquals("argument value", "1", args[0].getText()); }