Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit eb0b588

Browse files
committed
Remove caching of the config file - it causes problems.
1 parent 4200731 commit eb0b588

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

aicodebot/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def get_config_file():
1111
return config_file
1212

1313

14-
@functools.lru_cache
1514
def read_config():
1615
"""Read the config file and return its contents as a dictionary."""
1716
config_file = get_config_file()

tests/test_cli.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def test_configure(cli_runner, tmp_path, monkeypatch):
2222
# set aicodebot_config_file to the temp config file
2323
monkeypatch.setenv("AICODEBOT_CONFIG_FILE", str(temp_config_file))
2424

25-
read_config.cache_clear()
2625
assert read_config() is None
2726

2827
# run the setup command, should work with the env var set
@@ -34,15 +33,13 @@ def test_configure(cli_runner, tmp_path, monkeypatch):
3433
assert Path(temp_config_file).exists()
3534

3635
# load the config file
37-
read_config.cache_clear()
3836
config_data = read_config()
3937
# check if the config file contains the correct data
4038
assert config_data["openai_api_key"] == key
4139
assert config_data["personality"] == DEFAULT_PERSONALITY.name
4240

4341
# remove the config file
4442
Path.unlink(temp_config_file)
45-
read_config.cache_clear()
4643
assert read_config() is None
4744

4845
# now unset the env var and run the command again with it passed as a flag
@@ -53,7 +50,6 @@ def test_configure(cli_runner, tmp_path, monkeypatch):
5350
assert result.exit_code == 0, f"output: {result.output}"
5451

5552
# load the config file
56-
read_config.cache_clear()
5753
config_data = read_config()
5854
# check if the config file contains the correct data
5955
assert config_data["openai_api_key"] == key

0 commit comments

Comments
 (0)