[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
--- 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: