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()