From: Daniel D. <dan...@ba...> - 2012-02-01 14:28:42
|
Oleg Broytman <ph...@ph...> writes: > On Wed, Feb 01, 2012 at 02:53:20PM +0100, Daniel Dehennin wrote: >> I found a thread[4] on the list speaking about the same issue >> [4] http://thread.gmane.org/gmane.comp.python.sqlobject/5769 > > The thread has the answer, IMO. So, I should have not understand: #+begin_src test_init_job (TestJob.TestJob) ... E: setUp Cannot operate on a closed database. #+end_src I move the os.unlink fro the setUp() to tearDown() which call a new function: #+begin_src python def rebuildd_global_test_teardown(): try: Rebuildd().sqlconnection.close() sqlobject.sqlhub.processConnection = Rebuildd().sqlconnection sqlobject.dbconnection.TheURIOpener.cachedURIs={} os.unlink("/tmp/rebuildd-tests.db") except Exception, e: print "E: tearDown %s" % e pass #+end_src Regards. -- Daniel Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 |