summary refs log tree commit diff
path: root/tests/push
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-08-25 09:27:21 -0400
committerGitHub <noreply@github.com>2023-08-25 09:27:21 -0400
commita8a46b13360b8bd07cbca48798791098ef6d6d3c (patch)
tree074f5ad409df786f03c6f733ff541792ad9f0b7d /tests/push
parentAdd warnings about MSC3861 on certain APIs. (#16168) (diff)
downloadsynapse-a8a46b13360b8bd07cbca48798791098ef6d6d3c.tar.xz
Replace simple_async_mock with AsyncMock (#16180)
Python 3.8 has a native AsyncMock, use it instead of a custom
implementation.
Diffstat (limited to 'tests/push')
-rw-r--r--tests/push/test_bulk_push_rule_evaluator.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/push/test_bulk_push_rule_evaluator.py b/tests/push/test_bulk_push_rule_evaluator.py
index 937e6ebb7d..a3880ac171 100644
--- a/tests/push/test_bulk_push_rule_evaluator.py
+++ b/tests/push/test_bulk_push_rule_evaluator.py
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 from typing import Any, Optional
-from unittest.mock import patch
+from unittest.mock import AsyncMock, patch
 
 from parameterized import parameterized
 
@@ -28,7 +28,6 @@ from synapse.server import HomeServer
 from synapse.types import JsonDict, create_requester
 from synapse.util import Clock
 
-from tests.test_utils import simple_async_mock
 from tests.unittest import HomeserverTestCase, override_config
 
 
@@ -191,7 +190,7 @@ class TestBulkPushRuleEvaluator(HomeserverTestCase):
         # Mock the method which calculates push rules -- we do this instead of
         # e.g. checking the results in the database because we want to ensure
         # that code isn't even running.
-        bulk_evaluator._action_for_event_by_user = simple_async_mock()  # type: ignore[assignment]
+        bulk_evaluator._action_for_event_by_user = AsyncMock()  # type: ignore[assignment]
 
         # Ensure no actions are generated!
         self.get_success(bulk_evaluator.action_for_events_by_user([(event, context)]))