From 2fa3428581ce9ef439986b933277f84586a886a4 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 24 Mar 2021 16:44:48 +0000 Subject: [PATCH] JournalLock: Actually, just passing `None` as the tk.Tk parent works. In the PASSED case we never even make a JournalAlreadyLocked instance. In the FAILED case let it blow up on the `None`. --- tests/journal_lock.py/test_journal_lock.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/journal_lock.py/test_journal_lock.py b/tests/journal_lock.py/test_journal_lock.py index 4fe03671..321452bb 100644 --- a/tests/journal_lock.py/test_journal_lock.py +++ b/tests/journal_lock.py/test_journal_lock.py @@ -129,17 +129,6 @@ class TestJournalLock: m.setattr(config, "get_str", get_str) yield tmpdir_factory - @pytest.fixture - def mock_journalalreadylocked(self, monkeypatch: _pytest_monkeypatch) -> JournalLock: - """Fixture to mock JournalAlreadyLocked in JournalLock instance.""" - class MockJournalAlreadyLocked: - def __init__(self, parent, callback) -> None: - pass - - with monkeypatch.context() as m: - m.setattr(JournalLock, "JournalAlreadyLocked", MockJournalAlreadyLocked) - yield - ########################################################################### # Tests against JournalLock.__init__() def test_journal_lock_init(self, mock_journaldir: py_path_local_LocalPath): @@ -308,8 +297,7 @@ class TestJournalLock: # Tests against JournalLock.update_lock() def test_update_lock( self, - mock_journaldir_changing: py_path_local_LocalPath, - mock_journalalreadylocked): + mock_journaldir_changing: py_path_local_LocalPath): """ Test JournalLock.update_lock().