samedi 10 janvier 2015

Catching objects causing SQLite multiple thread access errors

I got this familiar sight when running my unit tests on Python and SQLite:



SQLite objects created in a thread can only be used in that same thread.


The tests run fine, but the errors are still being printed out. I assume SQLite objects somehow leak to the background thread.


Instead of dissecting my code piece by piece, is there a simple a way to




  • Put pdb breakpoint somewhere and see in which thread which object causes the violation (and thus figure out instantly how it ended up there in the first place).




  • Print out the objects (and parents which refer them) somehow with the error message




Aucun commentaire:

Enregistrer un commentaire