6b7e6b44f1
gh-pages / build (push) Waiting to run
Python Publish (pypi) / Upload release to PyPI (push) Waiting to run
Spellcheck / spellcheck (push) Waiting to run
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
30 lines
699 B
Python
30 lines
699 B
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
"""Test metrics configuration loading."""
|
|
|
|
import pytest
|
|
from graphrag_llm.config import (
|
|
MetricsConfig,
|
|
MetricsWriterType,
|
|
)
|
|
|
|
|
|
def test_file_metrics_writer_validation() -> None:
|
|
"""Test that missing required parameters raise validation errors."""
|
|
|
|
with pytest.raises(
|
|
ValueError,
|
|
match="base_dir must be specified for file-based metrics writer\\.",
|
|
):
|
|
_ = MetricsConfig(
|
|
writer=MetricsWriterType.File,
|
|
base_dir=" ",
|
|
)
|
|
|
|
# passes validation
|
|
_ = MetricsConfig(
|
|
writer=MetricsWriterType.File,
|
|
base_dir="./metrics",
|
|
)
|