Blob Blame History Raw
From 7187021ecc9f65601c50754d0fc6ec6c5264eea1 Mon Sep 17 00:00:00 2001
From: Asif Saif Uddin <auvipy@gmail.com>
Date: Wed, 18 Oct 2023 16:14:16 +0600
Subject: [PATCH] using assert_called_once() in est__pop_ready_uses_lock
 (#1813)

---
 t/unit/asynchronous/test_hub.py | 2 +-
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/unit/asynchronous/test_hub.py b/t/unit/asynchronous/test_hub.py
index e46d338df..97551dd1d 100644
--- a/t/unit/asynchronous/test_hub.py
+++ b/t/unit/asynchronous/test_hub.py
@@ -568,4 +568,4 @@ def test__pop_ready_pops_ready_items(self):
     def test__pop_ready_uses_lock(self):
         with patch.object(self.hub, '_ready_lock', autospec=True) as lock:
             self.hub._pop_ready()
-            assert lock.__enter__.called_once()
+            lock.__enter__.assert_called_once()
diff --git a/t/unit/asynchronous/test_hub.py b/t/unit/asynchronous/test_hub.py
index 27b048b94..e46d338df 100644
--- a/t/unit/asynchronous/test_hub.py
+++ b/t/unit/asynchronous/test_hub.py
@@ -193,7 +193,7 @@ def test_call_soon_uses_lock(self):
         callback = Mock(name='callback')
         with patch.object(self.hub, '_ready_lock', autospec=True) as lock:
             self.hub.call_soon(callback)
-            assert lock.__enter__.called_once()
+            lock.__enter__.assert_called_once()

     def test_call_soon__promise_argument(self):
         callback = promise(Mock(name='callback'), (1, 2, 3))