summaryrefslogtreecommitdiff
path: root/testlib.py
diff options
context:
space:
mode:
authorPierre-Yves David <pierre-yves.david@logilab.fr>2010-07-28 15:21:07 +0200
committerPierre-Yves David <pierre-yves.david@logilab.fr>2010-07-28 15:21:07 +0200
commite490ab1eb0bfa0125334ff55e6a6b62966e56d24 (patch)
tree099d7934fdc228fa76f712cfb7f91e6f4dab9687 /testlib.py
parent75eb499024c663c3607b6e1b20d98347f342f19e (diff)
downloadlogilab-common-e490ab1eb0bfa0125334ff55e6a6b62966e56d24.tar.gz
[teslib/refactoring] Use decorator.
Diffstat (limited to 'testlib.py')
-rw-r--r--testlib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/testlib.py b/testlib.py
index edcdc86..a6e0c1a 100644
--- a/testlib.py
+++ b/testlib.py
@@ -1036,6 +1036,8 @@ class TestCase(unittest.TestCase):
self._current_test_descr = None
self._options_ = None
+ @classproperty
+ @cached
def datadir(cls): # pylint: disable-msg=E0213
"""helper attribute holding the standard test's data directory
@@ -1045,12 +1047,11 @@ class TestCase(unittest.TestCase):
return osp.join(osp.dirname(osp.abspath(mod.__file__)), 'data')
# cache it (use a class method to cache on class since TestCase is
# instantiated for each test run)
- datadir = classproperty(cached(datadir))
+ @classmethod
def datapath(cls, *fname):
"""joins the object's datadir and `fname`"""
return osp.join(cls.datadir, *fname)
- datapath = classmethod(datapath)
def set_description(self, descr):
"""sets the current test's description.