Commits

Matt Chaput committed 98c1ae9

Fixed half-finished conversion to cleanup() method.

  • Participants
  • Parent commits b1f8445

Comments (0)

Files changed (1)

File src/whoosh/util/testing.py

         TempDir.__init__(self, **kwargs)
         self._debug = debug
 
+    def cleanup(self):
+        self.store.close()
+
     def __enter__(self):
         dirpath = TempDir.__enter__(self)
-        store = FileStorage(dirpath, debug=self._debug)
-        self.onexit = lambda: store.close()
-        return store
+        self.store = FileStorage(dirpath, debug=self._debug)
+        return self.store
 
 
 class TempIndex(TempStorage):