class _HistoryTestCase(unittest.TestCase): _db_path_ = join(dirname(__file__), "tmp", "history.sqlite") #TODO: could try with ":memory:" for RAM testing def setUp(self): frame = sys._getframe(1) meth = frame.f_locals["testMethod"] name = meth.__name__ self._db_path_ = join(dirname(self._db_path_), name+".sqlite") if not exists(dirname(self._db_path_)): os.makedirs(dirname(self._db_path_)) if exists(self._db_path_): os.remove(self._db_path_) self.history = History(self._db_path_) def tearDown(self): self.history.close() os.unlink(self._db_path_)
class _HistoryTestCase(unittest.TestCase): _db_path_ = join(dirname(__file__), "tmp", "history.sqlite") #TODO: could try with ":memory:" for RAM testing def setUp(self): frame = sys._getframe(1) meth = frame.f_locals["testMethod"] name = meth.__name__ self._db_path_ = join(dirname(self._db_path_), name + ".sqlite") if not exists(dirname(self._db_path_)): os.makedirs(dirname(self._db_path_)) if exists(self._db_path_): os.remove(self._db_path_) self.history = History(self._db_path_) def tearDown(self): self.history.close() os.unlink(self._db_path_)