mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 01:22:19 +03:00
tests/journal_lock: Minor typing fixes.
This commit is contained in:
parent
f52ffce79f
commit
25dfb0588a
@ -33,7 +33,7 @@ class JournalLock:
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Initialise where the journal directory and lock file are."""
|
||||
self.journal_dir: str = config.get_str('journaldir') or config.default_journal_dir
|
||||
self.journal_dir: str | None = config.get_str('journaldir') or config.default_journal_dir
|
||||
self.journal_dir_path: Optional[pathlib.Path] = None
|
||||
self.set_path_from_journaldir()
|
||||
self.journal_dir_lockfile_name: Optional[pathlib.Path] = None
|
||||
|
@ -121,7 +121,7 @@ class TestJournalLock:
|
||||
tmp_path_factory: _pytest_tmpdir.TempPathFactory
|
||||
) -> _pytest_tmpdir.TempPathFactory:
|
||||
"""Fixture for mocking config.get_str('journaldir')."""
|
||||
def get_str(key: str, *, default: str = None) -> str:
|
||||
def get_str(key: str, *, default: str | None = None) -> str:
|
||||
"""Mock config.*Config get_str to provide fake journaldir."""
|
||||
if key == 'journaldir':
|
||||
return str(tmp_path_factory.getbasetemp())
|
||||
@ -140,7 +140,7 @@ class TestJournalLock:
|
||||
tmp_path_factory: _pytest_tmpdir.TempPathFactory
|
||||
) -> _pytest_tmpdir.TempPathFactory:
|
||||
"""Fixture for mocking config.get_str('journaldir')."""
|
||||
def get_str(key: str, *, default: str = None) -> str:
|
||||
def get_str(key: str, *, default: str | None = None) -> str:
|
||||
"""Mock config.*Config get_str to provide fake journaldir."""
|
||||
if key == 'journaldir':
|
||||
return tmp_path_factory.mktemp("changing")
|
||||
|
Loading…
x
Reference in New Issue
Block a user