diff options
author | Pierre-Yves David <pierre-yves.david@logilab.fr> | 2010-07-28 15:21:07 +0200 |
---|---|---|
committer | Pierre-Yves David <pierre-yves.david@logilab.fr> | 2010-07-28 15:21:07 +0200 |
commit | e490ab1eb0bfa0125334ff55e6a6b62966e56d24 (patch) | |
tree | 099d7934fdc228fa76f712cfb7f91e6f4dab9687 /testlib.py | |
parent | 75eb499024c663c3607b6e1b20d98347f342f19e (diff) | |
download | logilab-common-e490ab1eb0bfa0125334ff55e6a6b62966e56d24.tar.gz |
[teslib/refactoring] Use decorator.
Diffstat (limited to 'testlib.py')
-rw-r--r-- | testlib.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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. |