diff options
| author | Michele Simionato <michele.simionato@gmail.com> | 2010-11-28 09:39:29 +0100 |
|---|---|---|
| committer | Michele Simionato <michele.simionato@gmail.com> | 2010-11-28 09:39:29 +0100 |
| commit | bbe48a4473a806342f3c22a192af3a8d62c81fad (patch) | |
| tree | 148603758b140954c3787c1bdcba1df0fefe56e0 /test.py | |
| parent | d5fe6439400b04265d471c5d4a526f103cd78fc2 (diff) | |
| download | python-decorator-git-bbe48a4473a806342f3c22a192af3a8d62c81fad.tar.gz | |
Fixed func_globals in the decorated function (release 3.2.1)
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +""" +Some simple tests executable with nose or py.test +""" + +import os +from decorator import decorator + +@decorator +def identity(f, *a, **k): + "do nothing decorator" + return f(*a, **k) + +@identity +def f1(): + "f1" + +def test0(): + assert os.path.basename(identity.func_globals['__file__']) == 'test.py' + print identity.__doc__ + +def test1(): + assert os.path.basename(f1.func_globals['__file__']) == 'test.py' + print f1.__doc__ + |
