devtools/testlib.py
changeset 10346 b926ff4ef4a8
parent 10335 88a4e4a60fce
child 10353 d9a1e7939ee6
--- a/devtools/testlib.py	Wed Apr 22 18:28:58 2015 +0200
+++ b/devtools/testlib.py	Fri Jun 06 17:08:08 2014 +0200
@@ -358,19 +358,9 @@
     @deprecated('[3.19] explicitly use RepoAccess object in test instead')
     def session(self):
         """return current server side session"""
-        # XXX We want to use a srv_connection instead and deprecate this
-        # property
         session = self._current_session
         if session is None:
             session = self._admin_session
-            # bypassing all sanity to use the same repo cnx in the session
-            #
-            # we can't call set_cnx as the Connection is not managed by the
-            # session.
-            session._Session__threaddata.cnx = self._admin_clt_cnx._cnx
-        else:
-            session._Session__threaddata.cnx = self.cnx._cnx
-        session.set_cnxset()
         return session
 
     @property
@@ -542,8 +532,7 @@
                 self._admin_clt_cnx.close()
             self._admin_clt_cnx = None
         if self._admin_session is not None:
-            if not self._admin_session.closed:
-                self.repo.close(self._admin_session.sessionid)
+            self.repo.close(self._admin_session.sessionid)
             self._admin_session = None
         while self._cleanups:
             cleanup, args, kwargs = self._cleanups.pop(-1)