Commit a7a6d02d authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into t2

* master:
  lib/zodb: Mark test_zconn_at as xfail on plain ZODB4
parents 6c54ad01 068f97c0
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# #
# See COPYING file for full licensing terms. # See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
from wendelin.lib.zodb import LivePersistent, deactivate_btree, dbclose, zconn_at, zstor_2zurl from wendelin.lib.zodb import LivePersistent, deactivate_btree, dbclose, zconn_at, zstor_2zurl, zmajor, _zhasNXDPatch
from wendelin.lib.testing import getTestDB from wendelin.lib.testing import getTestDB
from wendelin.lib import testing from wendelin.lib import testing
from persistent import Persistent, UPTODATE, GHOST, CHANGED from persistent import Persistent, UPTODATE, GHOST, CHANGED
...@@ -238,6 +238,9 @@ def test_deactivate_btree(): ...@@ -238,6 +238,9 @@ def test_deactivate_btree():
# verify that zconn_at gives correct answer. # verify that zconn_at gives correct answer.
@func @func
def test_zconn_at(): def test_zconn_at():
if zmajor == 4 and not _zhasNXDPatch('conn:MVCC-via-loadBefore-only'):
pytest.xfail(reason="zconn_at needs https://lab.nexedi.com/nexedi/ZODB/merge_requests/1 to work on ZODB4")
stor = testdb.getZODBStorage() stor = testdb.getZODBStorage()
defer(stor.close) defer(stor.close)
db = DB(stor) db = DB(stor)
......
...@@ -182,12 +182,17 @@ def before2at(before): # -> at ...@@ -182,12 +182,17 @@ def before2at(before): # -> at
# _zassertHasNXDPatch asserts that ZODB is patched with specified Nexedi-provided patch. # _zassertHasNXDPatch asserts that ZODB is patched with specified Nexedi-provided patch.
def _zassertHasNXDPatch(patch, details_link): def _zassertHasNXDPatch(patch, details_link):
nxd_patches = getattr(ZODB, 'nxd_patches', set()) if not _zhasNXDPatch(patch):
if patch not in nxd_patches:
raise AssertionError( raise AssertionError(
"ZODB%s is not patched with required Nexedi patch %r\n\tSee %s for details" % "ZODB%s is not patched with required Nexedi patch %r\n\tSee %s for details" %
(zmajor, patch, details_link)) (zmajor, patch, details_link))
# _zhasNXDPatch returns whether ZODB is patched with specified Nexedi-provided patch.
def _zhasNXDPatch(patch):
nxd_patches = getattr(ZODB, 'nxd_patches', set())
return (patch in nxd_patches)
# _zversion returns ZODB version object # _zversion returns ZODB version object
def _zversion(): def _zversion():
dzodb3 = pkg_resources.working_set.find(pkg_resources.Requirement.parse('ZODB3')) dzodb3 = pkg_resources.working_set.find(pkg_resources.Requirement.parse('ZODB3'))
......
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