diff options
author | Michele Simionato <michele.simionato@gmail.com> | 2013-11-24 06:49:22 +0100 |
---|---|---|
committer | Michele Simionato <michele.simionato@gmail.com> | 2013-11-24 06:49:22 +0100 |
commit | 3e2bd43069fa1837d77f8ab2079044a44aaedd66 (patch) | |
tree | 4d011907ca2a0c965a1a7d7a478f50be61060b69 /test.py | |
parent | 06a787e657bf26aab2c4e7b95a1336e087090ab5 (diff) | |
download | python-decorator-git-3e2bd43069fa1837d77f8ab2079044a44aaedd66.tar.gz |
Minor cleanup
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,5 @@ """ -Some simple tests executable with nose or py.test +Some simple tests """ import os @@ -15,7 +15,7 @@ def f1(): "f1" def getfname(func): - fname = os.path.basename(func.func_globals['__file__']) + fname = os.path.basename(func.__globals__['__file__']) return os.path.splitext(fname)[0] + '.py' def test0(): @@ -27,3 +27,8 @@ def test1(): this = getfname(f1) assert this == 'test.py', this print(f1.__doc__) + +if __name__ == '__main__': + for name, test in list(globals().items()): + if name.startswith('test'): + test() |