From 90ee63a57a73ccca6da10b4ad5e3ebd5a6775e58 Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Mon, 17 Feb 2025 09:26:41 +0000 Subject: [PATCH] pytest: not_called does not exist, use assert_not_called() instead --- test/unit/test_autoflush.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/test_autoflush.py b/test/unit/test_autoflush.py index 2579055a7..8560f7300 100644 --- a/test/unit/test_autoflush.py +++ b/test/unit/test_autoflush.py @@ -21,10 +21,12 @@ from pyocd.core.exceptions import TransferError from pyocd.utility.autoflush import Autoflush + @pytest.fixture(scope='function') def mock_obj(): return mock.Mock() + class TestAutoflush: def test_flushed(self, mock_obj): with Autoflush(mock_obj): @@ -35,5 +37,4 @@ def test_transfer_err_not_flushed(self, mock_obj): with pytest.raises(TransferError): with Autoflush(mock_obj): raise TransferError("bad joojoo") - assert mock_obj.flush.not_called - + mock_obj.flush.assert_not_called()