Commit 6115871c authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #120 from zopefoundation/fix-zodb-55-tests

Fix tests under ZODB 5.5
parents 7276ed47 082ff317
...@@ -28,6 +28,9 @@ install_requires = [ ...@@ -28,6 +28,9 @@ install_requires = [
] ]
tests_require = [ tests_require = [
# We rely on implementation details of
# test mocks. See https://github.com/zopefoundation/ZODB/pull/222
'ZODB >= 5.5.1',
'zope.testing', 'zope.testing',
'manuel', 'manuel',
'random2', 'random2',
......
...@@ -355,6 +355,29 @@ class FullGenericTests( ...@@ -355,6 +355,29 @@ class FullGenericTests(
): ):
"""Extend GenericTests with tests that MappingStorage can't pass.""" """Extend GenericTests with tests that MappingStorage can't pass."""
def checkPackUndoLog(self):
# PackableStorage.PackableUndoStorage wants to adjust
# time.sleep and time.time to cooperate and pretend for time
# to pass. That doesn't work for the spawned server, and this
# test case is very sensitive to times matching.
super_meth = super(FullGenericTests, self).checkPackUndoLog
# Find the underlying function, not the decorated method.
# If it doesn't exist, the implementation has changed and we
# need to revisit this...
try:
underlying_func = super_meth.__wrapped__
except AttributeError:
# ...unless we're on Python 2, which doesn't have the __wrapped__
# attribute.
if bytes is not str: # pragma: no cover Python 3
raise
unbound_func = PackableStorage.PackableUndoStorage.checkPackUndoLog
wrapper_func = unbound_func.__func__
underlying_func = wrapper_func.func_closure[0].cell_contents
underlying_func(self)
class FileStorageRecoveryTests(StorageTestBase.StorageTestBase, class FileStorageRecoveryTests(StorageTestBase.StorageTestBase,
RecoveryStorage.RecoveryStorage): RecoveryStorage.RecoveryStorage):
...@@ -432,6 +455,7 @@ class FileStorageTests(FullGenericTests): ...@@ -432,6 +455,7 @@ class FileStorageTests(FullGenericTests):
self._storage._info['interfaces'] self._storage._info['interfaces']
) )
class FileStorageSSLTests(FileStorageTests): class FileStorageSSLTests(FileStorageTests):
def getZEOConfig(self): def getZEOConfig(self):
......
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