[devtools] vreg becomes a class ppty
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 07 Dec 2012 16:10:38 +0100
changeset 9029 5941cde49878
parent 9028 c88261b641a9
child 9030 c1d5e8ca15ea
[devtools] vreg becomes a class ppty After multiple devtools refactoring, the vreg used for test is now *always* got from the repository. Making this explicit is a step toward simplification of the vreg handling during various initialisation phases. Related to #2944813
devtools/testlib.py
--- a/devtools/testlib.py	Fri Nov 23 16:33:00 2012 +0100
+++ b/devtools/testlib.py	Fri Dec 07 16:10:38 2012 +0100
@@ -251,11 +251,14 @@
         # no direct assignation to cls.cnx anymore.
         # cnx is now an instance property that use a class protected attributes.
         cls.set_cnx(cnx)
-        cls.vreg = cls.repo.vreg
         cls.websession = dbapi.DBAPISession(cnx, cls.admlogin)
         cls._orig_cnx = (cnx, cls.websession)
         cls.config.repository = lambda x=None: cls.repo
 
+    @classproperty
+    def vreg(cls):
+        return cls.repo.vreg
+
     def _close_cnx(self):
         for cnx in list(self._cnxs):
             if not cnx._closed: