[Tutor] Immediately committing changes to shelve files

Mike Meisner mikem at blazenetme.net
Mon Oct 27 03:37:42 CET 2008


I'm running a number of test cases and saving their results in a shelve file.

A full run of the test cases takes about 36 hours.  During that time, if something interrupts the run (e.g., a power outage, which has happened), I find that none of the completed test cases have been committed to the shelve file even though, after each run, I make sure that the results are written to the in-memory database (i.e., db = shelve.open(filename) at the beginning of the test run; and db[key] = results after each test case).

Is there a way to force the results for a single test case to be written back to the shelve file?  Other than opening/closing the shelve after each test case run?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081026/96cfccb8/attachment.htm>


More information about the Tutor mailing list