diff options
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() |
