Commit c922735b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d9e13fbe
......@@ -23,6 +23,7 @@ from wendelin.lib import testing
from persistent import Persistent, UPTODATE, GHOST, CHANGED
from ZODB import DB, POSException
from ZODB.FileStorage import FileStorage
from ZODB.MappingStorage import MappingStorage
from BTrees.IOBTree import IOBTree
import transaction
from transaction import TransactionManager
......@@ -291,7 +292,7 @@ def test_zconn_at():
assert zconn_at(conn2) == at0
# reopen conn2 -> view upated to @at1_
# reopen conn2 -> view updated to @at1_
conn2.close()
conn2_ = db.open(transaction_manager=tm1)
assert conn2_ is conn2 # from DB pool
......@@ -373,13 +374,17 @@ def test_zurlstable():
# ---- tests for critical properties of ZODB ----
# verify race in between Connection.open and invalidations.
def test_zodb_zopenrace_basic():
# exercises mostly logic inside ZODB around ZODB.Connection
zopenrace.test(MappingStorage())
def test_zodb_zopenrace():
# exercises ZODB.Connection + particular storage implementation
zopenrace.main()
# verify race in between loading and invalidations.
def test_zodb_zloadrace():
# skip testing with FileStorage - in ZODB/py opening simultaneous read-write
# connections to the same file is not supported and will raise Lockerror.
# connections to the same file is not supported and will raise LockError.
_ = testdb.getZODBStorage()
_.close()
if isinstance(_, FileStorage):
......
......@@ -111,8 +111,13 @@ def main():
defer(tdb.teardown)
zstor = tdb.getZODBStorage()
db = DB(zstor)
defer(zstor.close)
test(zstor)
@func
def test(zstor):
db = DB(zstor)
defer(db.close)
# init initializes the database with two integer objects - obj1/obj2 that are set to 0.
def init():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment