summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2011-07-15 15:28:03 +0200
committerMichele Simionato <michele.simionato@gmail.com>2011-07-15 15:28:03 +0200
commitd84abb0c315ed045fa2809d74c4b7465c291517d (patch)
tree137cdda302b659f1af643cafb357c93c84226780
parent68e5691ddde6246cd22c7cc6e0b189f2b343e661 (diff)
downloadmicheles-d84abb0c315ed045fa2809d74c4b7465c291517d.tar.gz
Fixed two tests of the decorator module
-rw-r--r--decorator/test.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/decorator/test.py b/decorator/test.py
index 6c24b15..455fa1c 100644
--- a/decorator/test.py
+++ b/decorator/test.py
@@ -14,11 +14,16 @@ def identity(f, *a, **k):
def f1():
"f1"
+def getfname(func):
+ fname = os.path.basename(func.func_globals['__file__'])
+ return os.path.splitext(fname)[0] + '.py'
+
def test0():
- assert os.path.basename(identity.func_globals['__file__']) == 'test.py'
+ this = getfname(identity)
+ assert this == 'test.py', this
print(identity.__doc__)
def test1():
- assert os.path.basename(f1.func_globals['__file__']) == 'test.py'
+ this = getfname(f1)
+ assert this == 'test.py', this
print(f1.__doc__)
-