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`.
This commit is contained in:
Athanasius committed 2021-04-01 14:45:52 +01:00
1 parent baca42f06e
commit 2fa3428581
1 file changed
+1 -13
+1 -13
View File
@@ -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().