From d84abb0c315ed045fa2809d74c4b7465c291517d Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Fri, 15 Jul 2011 15:28:03 +0200 Subject: Fixed two tests of the decorator module --- decorator/test.py | 11 ++++++++--- 1 file 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__) - -- cgit v1.2.1