diff --git a/tests/helpers/test_stubs.py b/tests/helpers/test_stubs.py index 10fa9e5db..a5c1d27fb 100644 --- a/tests/helpers/test_stubs.py +++ b/tests/helpers/test_stubs.py @@ -36,8 +36,8 @@ def test_timeout(timer): func2 = mock.Mock() timer.timeout.connect(func) timer.timeout.connect(func2) - assert not func.called - assert not func2.called + func.assert_not_called() + func2.assert_not_called() timer.timeout.emit() func.assert_called_once_with() func2.assert_called_once_with() @@ -49,7 +49,7 @@ def test_disconnect_all(timer): timer.timeout.connect(func) timer.timeout.disconnect() timer.timeout.emit() - assert not func.called + func.assert_not_called() def test_disconnect_one(timer): @@ -58,7 +58,7 @@ def test_disconnect_one(timer): timer.timeout.connect(func) timer.timeout.disconnect(func) timer.timeout.emit() - assert not func.called + func.assert_not_called() def test_disconnect_all_invalid(timer): @@ -74,8 +74,8 @@ def test_disconnect_one_invalid(timer): timer.timeout.connect(func1) with pytest.raises(TypeError): timer.timeout.disconnect(func2) - assert not func1.called - assert not func2.called + func1.assert_not_called() + func2.assert_not_called() timer.timeout.emit() func1.assert_called_once_with() diff --git a/tests/unit/completion/test_completionmodel.py b/tests/unit/completion/test_completionmodel.py index 9e73e533a..292349730 100644 --- a/tests/unit/completion/test_completionmodel.py +++ b/tests/unit/completion/test_completionmodel.py @@ -103,7 +103,7 @@ def test_delete_cur_item_no_func(): parent = model.index(0, 0) with pytest.raises(cmdexc.CommandError): model.delete_cur_item(model.index(0, 0, parent)) - assert not callback.called + callback.assert_not_called() def test_delete_cur_item_no_cat(): @@ -114,4 +114,4 @@ def test_delete_cur_item_no_cat(): model.rowsRemoved.connect(callback) with pytest.raises(qtutils.QtValueError): model.delete_cur_item(QModelIndex()) - assert not callback.called + callback.assert_not_called() diff --git a/tests/unit/completion/test_completionwidget.py b/tests/unit/completion/test_completionwidget.py index 7eb7fe2b5..22c71a2b7 100644 --- a/tests/unit/completion/test_completionwidget.py +++ b/tests/unit/completion/test_completionwidget.py @@ -242,7 +242,7 @@ def test_completion_item_del_no_selection(completionview): completionview.set_model(model) with pytest.raises(cmdexc.CommandError, match='No item selected!'): completionview.completion_item_del() - assert not func.called + func.assert_not_called() def test_resize_no_model(completionview, qtbot): diff --git a/tests/unit/config/test_configinit.py b/tests/unit/config/test_configinit.py index fef352584..767ffd6ca 100644 --- a/tests/unit/config/test_configinit.py +++ b/tests/unit/config/test_configinit.py @@ -151,7 +151,7 @@ def test_late_init(init_patch, monkeypatch, fake_save_manager, fake_args, assert text.startswith('Errors occurred while reading config.py:') assert 'Error text: Exception' in text else: - assert not msgbox_mock.called + msgbox_mock.assert_not_called() class TestQtArgs: diff --git a/tests/unit/misc/test_ipc.py b/tests/unit/misc/test_ipc.py index d8024b207..874419511 100644 --- a/tests/unit/misc/test_ipc.py +++ b/tests/unit/misc/test_ipc.py @@ -380,7 +380,7 @@ class TestHandleConnection: monkeypatch.setattr(ipc_server._server, 'nextPendingConnection', m) ipc_server.ignored = True ipc_server.handle_connection() - assert not m.called + m.assert_not_called() def test_no_connection(self, ipc_server, caplog): ipc_server.handle_connection() diff --git a/tests/unit/utils/test_standarddir.py b/tests/unit/utils/test_standarddir.py index 3dcb282d2..20ea88645 100644 --- a/tests/unit/utils/test_standarddir.py +++ b/tests/unit/utils/test_standarddir.py @@ -494,17 +494,17 @@ def test_init(mocker, tmpdir, args_kind): assert standarddir._locations != {} if args_kind == 'normal': if utils.is_mac: - assert not m_windows.called + m_windows.assert_not_called() assert m_mac.called elif utils.is_windows: assert m_windows.called - assert not m_mac.called + m_mac.assert_not_called() else: - assert not m_windows.called - assert not m_mac.called + m_windows.assert_not_called() + m_mac.assert_not_called() else: - assert not m_windows.called - assert not m_mac.called + m_windows.assert_not_called() + m_mac.assert_not_called() @pytest.mark.linux