3588350
From a8620178a6f7c8726413c9a17a28b57cbe6fe942 Mon Sep 17 00:00:00 2001
3588350
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
3588350
Date: Tue, 19 Dec 2023 20:58:21 -0500
3588350
Subject: [PATCH] Drop PyPI mock dependency; use unittest.mock instead
3588350
3588350
This is available in the Python standard library from version 3.3; sure
3588350
advertises support for 3.6 and later in setup.py
3588350
---
3588350
 setup.py                        | 2 +-
3588350
 sure/core.py                    | 5 +----
3588350
 tests/test_assertion_builder.py | 2 +-
3588350
 tox.ini                         | 1 -
3588350
 4 files changed, 3 insertions(+), 7 deletions(-)
3588350
3588350
diff --git a/setup.py b/setup.py
3588350
index ebc24c5..9e6d653 100755
3588350
--- a/setup.py
3588350
+++ b/setup.py
3588350
@@ -81,7 +81,7 @@ def read_readme():
3588350
         return __doc__
3588350
 
3588350
 
3588350
-install_requires = ["mock", "six"]
3588350
+install_requires = ["six"]
3588350
 tests_require = ["nose"]
3588350
 version = read_version()
3588350
 
3588350
diff --git a/sure/core.py b/sure/core.py
3588350
index e953c52..57e95fe 100644
3588350
--- a/sure/core.py
3588350
+++ b/sure/core.py
3588350
@@ -18,10 +18,7 @@
3588350
 
3588350
 import os
3588350
 
3588350
-try:
3588350
-    from mock import _CallList
3588350
-except ImportError:
3588350
-    from mock.mock import _CallList
3588350
+from unittest.mock import _CallList
3588350
 
3588350
 import inspect
3588350
 from six import (
3588350
diff --git a/tests/test_assertion_builder.py b/tests/test_assertion_builder.py
3588350
index 2653f1a..15bc612 100644
3588350
--- a/tests/test_assertion_builder.py
3588350
+++ b/tests/test_assertion_builder.py
3588350
@@ -17,7 +17,7 @@
3588350
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
3588350
 from __future__ import unicode_literals
3588350
 import re
3588350
-import mock
3588350
+from unittest import mock
3588350
 from collections import OrderedDict
3588350
 
3588350
 from datetime import datetime, timedelta
3588350
diff --git a/tox.ini b/tox.ini
3588350
index e29633e..bb94414 100644
3588350
--- a/tox.ini
3588350
+++ b/tox.ini
3588350
@@ -10,7 +10,6 @@ envlist = py27, pypy, py34, py35, py36, py37
3588350
 commands = nosetests --rednose -vv --with-coverage --cover-package=sure
3588350
 deps =
3588350
     six
3588350
-    mock
3588350
     nose
3588350
     rednose
3588350
     coverage