Python Testing with Pytest: Tasks sample code tinydb api change

Hi Brian,

Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws an error and .truncate() is now required for the delete_all tasks function.

Don’t know the reason for the change but if I had a vote I would have voted for .defenestration() instead, much more expressive.

3 Likes

There are a couple changes to the tinydb api that we have to watch out for.
I recommend you pin tinydb to 3.15.1 for the book.
See Python Testing with pytest: tinydb needs pinned to 3.15.1 (code download)

1 Like