add error messages
Some checks failed
Mypy / mypy (push) Failing after 1m10s
Pytest / pytest (3.12) (push) Successful in 1m17s
Pytest / pytest (3.13) (push) Successful in 1m12s
Pytest / pytest (3.14) (push) Successful in 1m13s
Ruff / ruff (push) Successful in 1m1s

This commit is contained in:
Justus Kuhlmann 2026-03-23 15:21:34 +01:00
commit 110ddaf3a1
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
2 changed files with 14 additions and 3 deletions

View file

@ -2,6 +2,7 @@ from corrlib import tools as tl
from configparser import ConfigParser
import os
from pathlib import Path
import pytest
def test_m2k() -> None:
@ -74,7 +75,11 @@ def test_get_db_file(tmp_path: Path) -> None:
def test_cache_enabled(tmp_path: Path) -> None:
section = "core"
option = "cached"
value = "True"
# config is not yet available
tl.set_config(tmp_path, section, option, value)
assert tl.get_db_file(tmp_path)
tl.set_config(tmp_path, section, option, "True")
assert tl.cache_enabled(tmp_path)
tl.set_config(tmp_path, section, option, "False")
assert not tl.cache_enabled(tmp_path)
tl.set_config(tmp_path, section, option, "lalala")
with pytest.raises(ValueError) as e_info:
tl.cache_enabled(tmp_path)