title: Neo4j ImpermanentDatabase in python unittests
body: <p>I am trying to create unit tests for a python project that will interface with a Neo4j Graph database.  </p>
  
  <p>Currently, I am implementing the embedded graph database, but will likely migrate to a REST interface if I choose to deploy this to a web application. 
  I have intstalled v1.9rc2 of the embedded neo4j <a href="https://github.com/neo4j-contrib/python-embedded" rel="nofollow">project</a>, installed via <code>pip</code> on a virtual environment.</p>
  
  <p>There are mentionings of a java class <code>org.neo4j.test.TestGraphDatabaseFactory</code>, <a href="https://github.com/neo4j/neo4j/blob/1.9.4/community/embedded-examples/src/test/java/org/neo4j/examples/Neo4jBasicDocTest.java" rel="nofollow">here</a>, which sounds perfect for what I have in mind.   I am currently reading and writing to a database on file, which is ok, but I am having trouble properly cleaning up after ech test that doesn't include a call to <code>shutil.rmtree</code> ... or is that how it should be done?</p>
  
  <p>Another possible method is to create and shutdown the database for each test, via the <code>setUp</code> and <code>tearDown</code> methods of my <code>TestCase</code>.</p>
  
  <pre><code>&gt;&gt;&gt; import neo4j
  &gt;&gt;&gt; print neo4j.__version__
  '1.9.c2'
  </code></pre>