File python-ZEO-no-mock.patch of Package failed_python-ZEO
Index: ZEO-5.4.0/src/ZEO/tests/testZEO.py
===================================================================
--- ZEO-5.4.0.orig/src/ZEO/tests/testZEO.py
+++ ZEO-5.4.0/src/ZEO/tests/testZEO.py
@@ -83,7 +83,10 @@ class CreativeGetState(persistent.Persis
class Test_convenience_functions(unittest.TestCase):
def test_ZEO_client_convenience(self):
- import mock
+ try:
+ from unittest import mock as mock
+ except ImportError:
+ import mock
import ZEO
client_thread = mock.Mock(
@@ -95,7 +98,10 @@ class Test_convenience_functions(unittes
client._cache.close() # client thread responsibility
def test_ZEO_DB_convenience_ok(self):
- import mock
+ try:
+ from unittest import mock as mock
+ except ImportError:
+ import mock
import ZEO
client_mock = mock.Mock(spec=['close'])
@@ -113,7 +119,10 @@ class Test_convenience_functions(unittes
client_mock.close.assert_not_called()
def test_ZEO_DB_convenience_error(self):
- import mock
+ try:
+ from unittest import mock as mock
+ except ImportError:
+ import mock
import ZEO
client_mock = mock.Mock(spec=['close'])
@@ -131,7 +140,10 @@ class Test_convenience_functions(unittes
client_mock.close.assert_called_once()
def test_ZEO_connection_convenience_ok(self):
- import mock
+ try:
+ from unittest import mock as mock
+ except ImportError:
+ import mock
import ZEO
ret = object()
@@ -150,7 +162,10 @@ class Test_convenience_functions(unittes
DB_mock.close.assert_not_called()
def test_ZEO_connection_convenience_value(self):
- import mock
+ try:
+ from unittest import mock as mock
+ except ImportError:
+ import mock
import ZEO
DB_mock = mock.Mock(spec=[
Index: ZEO-5.4.0/src/ZEO/tests/testZEOServer.py
===================================================================
--- ZEO-5.4.0.orig/src/ZEO/tests/testZEOServer.py
+++ ZEO-5.4.0/src/ZEO/tests/testZEOServer.py
@@ -1,6 +1,9 @@
import unittest
-import mock
+try:
+ from unittest import mock as mock
+except ImportError:
+ import mock
from ZEO._compat import PY3
from ZEO.runzeo import ZEOServer
Index: ZEO-5.4.0/src/ZEO/tests/testssl.py
===================================================================
--- ZEO-5.4.0.orig/src/ZEO/tests/testssl.py
+++ ZEO-5.4.0/src/ZEO/tests/testssl.py
@@ -1,9 +1,12 @@
from .._compat import PY3
-import mock
import os
import ssl
import unittest
+try:
+ from unittest import mock as mock
+except ImportError:
+ import mock
from ZODB.config import storageFromString
from ..Exceptions import ClientDisconnected
Index: ZEO-5.4.0/src/ZEO/asyncio/tests.py
===================================================================
--- ZEO-5.4.0.orig/src/ZEO/asyncio/tests.py
+++ ZEO-5.4.0/src/ZEO/asyncio/tests.py
@@ -12,7 +12,10 @@ else:
from zope.testing import setupstack
from unittest import TestCase
-import mock
+try:
+ from unittest import mock as mock
+except ImportError:
+ import mock
from ZODB.utils import maxtid, RLock
import collections