From c35da048202a7c2e215ac04b201dd1d0655b14c8 Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 9 Aug 2013 18:12:51 +0430 Subject: [PATCH] illegal decorators tests --- test/completion/decorators.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/completion/decorators.py b/test/completion/decorators.py index 5893e7b4..ef9bd676 100644 --- a/test/completion/decorators.py +++ b/test/completion/decorators.py @@ -142,6 +142,29 @@ JustAClass.a.__closure__ #? int() JustAClass.a() +# ----------------- +# illegal decorators +# ----------------- + +class DecoratorWithoutCall(): + def __init__(self, func): + self.func = func + def __call__(self): + return self.func() + +@DecoratorWithoutCall +def f(): + return 1 + +@DecoratorWithoutCall(None) +def g(): + return 1 + +#? +f() +#? int() +g() + # ----------------- # method decorators # -----------------