ethereum/pyethereum — pull request #138 by jorisbontje (2014-08-12 16:50:48+00:00)
Title: LevelDB lock when running tester and pyethereum node

Using pyethereum.tester while another instance of pyethereum is running on the same machine returns:
```
self = , dbfile = '/Users/mids/Library/Application Support/Pyethereum/statedb'

def __init__(self, dbfile):
self.dbfile = dbfile
if dbfile not in databases:
databases[dbfile] = (
> leveldb.LevelDB(dbfile), dict(), threading.Lock())
E LevelDBError: IO error: lock /Users/mids/Library/Application Support/Pyethereum/statedb/LOCK: Resource temporarily unavailable

../../../.virtualenvs/trustdavis/lib/python2.7/site-packages/pyethereum/db.py:13: LevelDBError
```

This is prevented by setting the `data_dir` for `pyethereum.tester` to a temporary directory.

In the same way `tester_indexdb.py` also failed when pyethereum is running, while a py.test fixture was used; it isn't done consistently nor is it cleaned up afterwards.