python-sure/python-sure-no-mock.patch

38 lines
1.0 KiB
Diff
Raw Permalink Normal View History

Index: sure-2.0.0/sure/core.py
===================================================================
--- sure-2.0.0.orig/sure/core.py
+++ sure-2.0.0/sure/core.py
@@ -21,7 +21,10 @@ import os
try:
from mock import _CallList
except ImportError:
- from mock.mock import _CallList
+ try:
+ from mock.mock import _CallList
+ except ImportError:
+ from unittest.mock import _CallList
import inspect
from six import (
@@ -40,6 +43,7 @@ class Anything(object):
def __eq__(self, _):
return True
+
anything = Anything()
Index: sure-2.0.0/tests/test_assertion_builder.py
===================================================================
--- sure-2.0.0.orig/tests/test_assertion_builder.py
+++ sure-2.0.0/tests/test_assertion_builder.py
@@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
import re
-import mock
+from unittest import mock
from collections import OrderedDict
from datetime import datetime, timedelta