summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2015-07-21 16:43:59 +0200
committerMichele Simionato <michele.simionato@gmail.com>2015-07-21 16:43:59 +0200
commit10e035eaf93997a63a30687f6fe33b918714ba61 (patch)
tree7bc04aceba74e15306e54b542414cdda99291de1 /test.py
parent5e4bc16af3f5d0e6eca3ac95ddb89ef4331c8fb8 (diff)
downloadpython-decorator-git-10e035eaf93997a63a30687f6fe33b918714ba61.tar.gz
First version of dispatch_on
Diffstat (limited to 'test.py')
-rw-r--r--test.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/test.py b/test.py
deleted file mode 100644
index 89b25c1..0000000
--- a/test.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-Some simple tests
-"""
-
-import os
-import sys
-import time
-import doctest
-from decorator import decorator
-import documentation
-
-
-@decorator
-def identity(f, *a, **k):
- "do nothing decorator"
- return f(*a, **k)
-
-
-@identity
-def f1():
- "f1"
-
-
-def getfname(func):
- fname = os.path.basename(func.__globals__['__file__'])
- return os.path.splitext(fname)[0] + '.py'
-
-
-def test0():
- this = getfname(identity)
- assert this == 'test.py', this
-
-
-def test1():
- this = getfname(f1)
- assert this == 'test.py', this
-
-
-if __name__ == '__main__':
- t0 = time.time()
- for name, test in list(globals().items()):
- if name.startswith('test'):
- test()
- err = doctest.testmod(documentation)[0]
- t1 = time.time()
- print('Tests run in %s seconds' % (t1 - t0))
- sys.exit(err)