summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2013-11-24 06:49:22 +0100
committerMichele Simionato <michele.simionato@gmail.com>2013-11-24 06:49:22 +0100
commit3e2bd43069fa1837d77f8ab2079044a44aaedd66 (patch)
tree4d011907ca2a0c965a1a7d7a478f50be61060b69 /test.py
parent06a787e657bf26aab2c4e7b95a1336e087090ab5 (diff)
downloadpython-decorator-git-3e2bd43069fa1837d77f8ab2079044a44aaedd66.tar.gz
Minor cleanup
Diffstat (limited to 'test.py')
-rw-r--r--test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test.py b/test.py
index 455fa1c..460c36a 100644
--- a/test.py
+++ b/test.py
@@ -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()