
import unittest

import pentai.base.t_all as b_t
import pentai.ai.t_all as ai_t
import pentai.db.t_all as db_t
import pentai.db.zodb_dict as z_m

import os

def suite():
    global all_tests
    all_tests = unittest.TestSuite()
    all_tests.addTest(b_t.suite())
    all_tests.addTest(ai_t.suite())
    all_tests.addTest(db_t.suite())

    return all_tests

def main():
    z_m.set_db("test.db")

    unittest.TextTestRunner().run(suite())
    
    os.unlink("test.db")
    os.unlink("test.db.lock")
    os.unlink("test.db.tmp")
    os.unlink("test.db.index")

if __name__ == "__main__":
    main()


import unittest

import pentai.base.t_all as b_t
import pentai.ai.t_all as ai_t
import pentai.db.t_all as db_t
import pentai.db.zodb_dict as z_m
import pentai.db.test_db as tdb_m

def suite():
    global all_tests
    all_tests = unittest.TestSuite()
    all_tests.addTest(b_t.suite())
    all_tests.addTest(ai_t.suite())
    all_tests.addTest(db_t.suite())

    return all_tests

def main():
    unittest.TextTestRunner().run(suite())

if __name__ == "__main__":
    main()
    tdb_m.delete_test_db()

Delete test db after a run
Delete test db after a run

  
  import unittest
  
  import pentai.base.t_all as b_t
  import pentai.ai.t_all as ai_t
  import pentai.db.t_all as db_t
  import pentai.db.zodb_dict as z_m
+ import pentai.db.test_db as tdb_m
- 
- import os
  
  def suite():
      global all_tests
      all_tests = unittest.TestSuite()
      all_tests.addTest(b_t.suite())
      all_tests.addTest(ai_t.suite())
      all_tests.addTest(db_t.suite())
  
      return all_tests
  
  def main():
-     z_m.set_db("test.db")
- 
      unittest.TextTestRunner().run(suite())
-     
-     os.unlink("test.db")
-     os.unlink("test.db.lock")
-     os.unlink("test.db.tmp")
-     os.unlink("test.db.index")
  
  if __name__ == "__main__":
      main()
+     tdb_m.delete_test_db()
  
Delete test db after a run
## Code Before:

import unittest

import pentai.base.t_all as b_t
import pentai.ai.t_all as ai_t
import pentai.db.t_all as db_t
import pentai.db.zodb_dict as z_m

import os

def suite():
    global all_tests
    all_tests = unittest.TestSuite()
    all_tests.addTest(b_t.suite())
    all_tests.addTest(ai_t.suite())
    all_tests.addTest(db_t.suite())

    return all_tests

def main():
    z_m.set_db("test.db")

    unittest.TextTestRunner().run(suite())
    
    os.unlink("test.db")
    os.unlink("test.db.lock")
    os.unlink("test.db.tmp")
    os.unlink("test.db.index")

if __name__ == "__main__":
    main()

## Instruction:
Delete test db after a run
## Code After:

import unittest

import pentai.base.t_all as b_t
import pentai.ai.t_all as ai_t
import pentai.db.t_all as db_t
import pentai.db.zodb_dict as z_m
import pentai.db.test_db as tdb_m

def suite():
    global all_tests
    all_tests = unittest.TestSuite()
    all_tests.addTest(b_t.suite())
    all_tests.addTest(ai_t.suite())
    all_tests.addTest(db_t.suite())

    return all_tests

def main():
    unittest.TextTestRunner().run(suite())

if __name__ == "__main__":
    main()
    tdb_m.delete_test_db()
