[ldap tests] cleanup in preparation of #2542083 stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Mon, 17 Dec 2012 14:40:03 +0100
branchstable
changeset 8634 22f1800ca6a9
parent 8633 36197bd1d78b
child 8635 c261d9465e65
[ldap tests] cleanup in preparation of #2542083
server/test/unittest_ldapuser.py
--- a/server/test/unittest_ldapuser.py	Mon Dec 17 14:26:41 2012 +0100
+++ b/server/test/unittest_ldapuser.py	Mon Dec 17 14:40:03 2012 +0100
@@ -103,9 +103,9 @@
         session.create_entity('CWSource', name=u'ldapuser', type=u'ldapfeed', parser=u'ldapfeed',
                               url=URL, config=CONFIG)
         session.commit()
-        isession = session.repo.internal_session(safe=True)
-        lfsource = isession.repo.sources_by_uri['ldapuser']
-        stats = lfsource.pull_data(isession, force=True, raise_on_error=True)
+        with session.repo.internal_session(safe=True) as isession:
+            lfsource = isession.repo.sources_by_uri['ldapuser']
+            stats = lfsource.pull_data(isession, force=True, raise_on_error=True)
 
     def _pull(self):
         with self.session.repo.internal_session() as isession: