File matrix-synapse-async-mock.patch of Package matrix-synapse

From 5f8fa40a8d0fb0a1300414daf910c2ca8873058a Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 14 Dec 2021 19:52:22 +0000
Subject: [PATCH] Use mock from unittest package.

This is needed because standalone mock supports async mocks
only starting with version 4.0.0, and Fedora has 3.0.5.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 setup.py                                | 4 +---
 tests/storage/test_background_update.py | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/setup.py b/setup.py
index 2c6fb9aac..bfca16727 100755
--- a/setup.py
+++ b/setup.py
@@ -119,9 +119,7 @@ CONDITIONAL_REQUIREMENTS["mypy"] = [
 # Tests assume that all optional dependencies are installed.
 #
 # parameterized_class decorator was introduced in parameterized 0.7.0
-#
-# We use `mock` library as that backports `AsyncMock` to Python 3.6
-CONDITIONAL_REQUIREMENTS["test"] = ["parameterized>=0.7.0", "mock>=4.0.0"]
+CONDITIONAL_REQUIREMENTS["test"] = ["parameterized>=0.7.0"]
 
 CONDITIONAL_REQUIREMENTS["dev"] = (
     CONDITIONAL_REQUIREMENTS["lint"]
diff --git a/tests/storage/test_background_update.py b/tests/storage/test_background_update.py
index d77c00150..542b70a1e 100644
--- a/tests/storage/test_background_update.py
+++ b/tests/storage/test_background_update.py
@@ -12,8 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Use backported mock for AsyncMock support on Python 3.6.
-from mock import Mock
+from unittest.mock import Mock
 
 from twisted.internet.defer import Deferred, ensureDeferred
 
-- 
2.33.1