piskvorky / sqlitedict

Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Apache License 2.0
1.17k stars 131 forks source link

unittests separated & fixed issue with removing file until thread alive #8

Closed ownport closed 10 years ago

piskvorky commented 10 years ago

Looks good, thanks @ownport !

I'll check it out & test & merge this weekend.

piskvorky commented 10 years ago

The tests fail with

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
    self.run()
  File "/Users/kofola/workspace/sqlitedict/sqlitedict.py", line 255, in run
    conn = sqlite3.connect(self.filename, check_same_thread=False)
OperationalError: unable to open database file

Presumably because the (relative? from where?) path 'tests/db/sqlitedict-terminate.sqlite' doesn't exist.

ownport commented 10 years ago

The error OperationalError: unable to open database file was raised because the parent directory was absent. Added to sqlitedict.py check, if parent directory does not exists, create it.

The comments for creation new sqlitedict were old ones. Removed.

piskvorky commented 10 years ago

Merged!

Thanks to your proper tests rewrite @ownport , we can run automated Travis CI tests now. I'll set that up and prepare a new release today: 1.1.0.

piskvorky commented 10 years ago

CI tests added (had to make some minor changes, to be python < 2.7 compatible) and pass.

Thanks again Andrey. I'm adding you as committer, in case you find any other issues with sqlitedict.

ownport commented 10 years ago

Thanks