Skip to content

Commit

Permalink
fix: write and delete models for testing in a temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
umbertogriffo committed Jan 11, 2025
1 parent 3345129 commit 7204cad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/bot/client/test_lamacpp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def model_settings():


@pytest.fixture
def lamacpp_client(mock_model_folder, model_settings, cpu_config):
def lamacpp_client(mock_models_folder, model_settings, cpu_config):
with patch.object(model_settings, "config", cpu_config):
return LamaCppClient(mock_model_folder, model_settings)
return LamaCppClient(mock_models_folder, model_settings)


def test_generate_answer(lamacpp_client):
Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.fixture
def mock_model_folder(tmp_path):
model_folder = tmp_path / "models"
Path(model_folder).mkdir(parents=True, exist_ok=True)
return model_folder
def mock_models_folder(tmp_path):
models_folder = tmp_path / "models"
Path(models_folder).mkdir()
return models_folder

0 comments on commit 7204cad

Please sign in to comment.