Merge pull request 'add FileNotFound to db tests' (#36) from test/fnftools into develop
Some checks are pending
Mypy / mypy (push) Waiting to run
Pytest / pytest (3.12) (push) Waiting to run
Pytest / pytest (3.13) (push) Waiting to run
Pytest / pytest (3.14) (push) Waiting to run
Ruff / ruff (push) Waiting to run

Reviewed-on: #36
This commit is contained in:
Justus Kuhlmann 2026-04-21 16:16:30 +02:00
commit 0d01df1ca4

View file

@ -69,6 +69,8 @@ def test_get_db_file(tmp_path: Path) -> None:
# config is not yet available # config is not yet available
tl.set_config(tmp_path, section, option, value) tl.set_config(tmp_path, section, option, value)
assert tl.get_db_file(tmp_path) == Path("test_value") assert tl.get_db_file(tmp_path) == Path("test_value")
with pytest.raises(FileNotFoundError):
tl.get_db_file(tmp_path / "doesnotexist")
def test_cache_enabled(tmp_path: Path) -> None: def test_cache_enabled(tmp_path: Path) -> None:
@ -82,3 +84,5 @@ def test_cache_enabled(tmp_path: Path) -> None:
tl.set_config(tmp_path, section, option, "lalala") tl.set_config(tmp_path, section, option, "lalala")
with pytest.raises(ValueError): with pytest.raises(ValueError):
tl.cache_enabled(tmp_path) tl.cache_enabled(tmp_path)
with pytest.raises(FileNotFoundError):
tl.cache_enabled(tmp_path / "doesnotexist")