py4e
py4e copied to clipboard
db2.py fails travis tests due to missing db
If a change is made to db2.py in the code3/ folder, subsequent travis checks fail because the database + table don't exist/exist yet.
Thanks for this report! I'm going to be fixing a bunch of bugs and republishing the trinket HTML version of this in the next two weeks and will hit this.
The fix here is to add
cur.execute('DROP TABLE IF EXISTS Tracks')
cur.execute('CREATE TABLE Tracks (title TEXT, plays INTEGER)')
Above the INSERTS
. The code presumes that db1.py
has already run but this fix makes it work regardless of that.