use pathlib.Path for directories and files
Some checks failed
Ruff / ruff (push) Waiting to run
Pytest / pytest (3.12) (push) Successful in 1m15s
Pytest / pytest (3.13) (push) Has been cancelled
Mypy / mypy (push) Successful in 1m13s
Pytest / pytest (3.14) (push) Has been cancelled

This commit is contained in:
Justus Kuhlmann 2026-03-23 16:15:55 +01:00
commit 8162758cec
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
13 changed files with 137 additions and 125 deletions

View file

@ -39,7 +39,7 @@ def test_set_config(tmp_path: Path) -> None:
value = "test_value"
# config is not yet available
tl.set_config(tmp_path, section, option, value)
config_path = os.path.join(tmp_path, '.corrlib')
config_path = tmp_path / '.corrlib'
config = ConfigParser()
config.read(config_path)
assert config.get('core', 'test_option', fallback="not the value") == "test_value"
@ -48,7 +48,7 @@ def test_set_config(tmp_path: Path) -> None:
option = "test_option2"
value = "test_value2"
tl.set_config(tmp_path, section, option, value)
config_path = os.path.join(tmp_path, '.corrlib')
config_path = tmp_path / '.corrlib'
config = ConfigParser()
config.read(config_path)
assert config.get('core', 'test_option2', fallback="not the value") == "test_value2"
@ -57,7 +57,7 @@ def test_set_config(tmp_path: Path) -> None:
option = "test_option2"
value = "test_value3"
tl.set_config(tmp_path, section, option, value)
config_path = os.path.join(tmp_path, '.corrlib')
config_path = tmp_path / '.corrlib'
config = ConfigParser()
config.read(config_path)
assert config.get('core', 'test_option2', fallback="not the value") == "test_value3"
@ -69,7 +69,7 @@ def test_get_db_file(tmp_path: Path) -> None:
value = "test_value"
# config is not yet available
tl.set_config(tmp_path, section, option, value)
assert tl.get_db_file(tmp_path) == "test_value"
assert tl.get_db_file(tmp_path) == Path("test_value")
def test_cache_enabled(tmp_path: Path) -> None: