Skip to content

Commit

Permalink
added a test to verify that various references are cleared on close
Browse files Browse the repository at this point in the history
  • Loading branch information
agroszer committed Oct 18, 2016
1 parent a7b68a1 commit 52882f5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/ZODB/tests/testDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,31 @@ def minimally_test_connection_timeout():
"""

def cleanup_on_close():
"""Verify that various references are cleared on close
>>> db = ZODB.DB(None)
>>> conn = db.open()
>>> conn.root.x = 'x'
>>> transaction.commit()
>>> conn.close()
>>> historical_conn = db.open(at=db.lastTransaction())
>>> historical_conn.close()
>>> db.close()
>>> db.databases
{}
>>> db.pool.pop() is None
True
>>> [pool is None for pool in db.historical_pool.pools.values()]
[]
"""

def test_suite():
s = unittest.makeSuite(DBTests)
s.addTest(doctest.DocTestSuite(
Expand Down

0 comments on commit 52882f5

Please sign in to comment.