forked from phoenix-oss/llama-stack-mirror
Lint check in main branch is failing. This fixes the lint check after we moved to ruff in https://github.com/meta-llama/llama-stack/pull/921. We need to move to a `ruff.toml` file as well as fixing and ignoring some additional checks. Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
import pytest
|
|
|
|
from ..conftest import get_provider_fixture_overrides
|
|
|
|
from ..datasetio.fixtures import DATASETIO_FIXTURES
|
|
|
|
from .fixtures import POST_TRAINING_FIXTURES
|
|
|
|
DEFAULT_PROVIDER_COMBINATIONS = [
|
|
pytest.param(
|
|
{
|
|
"post_training": "torchtune",
|
|
"datasetio": "huggingface",
|
|
},
|
|
id="torchtune_post_training_huggingface_datasetio",
|
|
marks=pytest.mark.torchtune_post_training_huggingface_datasetio,
|
|
),
|
|
]
|
|
|
|
|
|
def pytest_configure(config):
|
|
combined_fixtures = "torchtune_post_training_huggingface_datasetio"
|
|
config.addinivalue_line(
|
|
"markers",
|
|
f"{combined_fixtures}: marks tests as {combined_fixtures} specific",
|
|
)
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
|
if "post_training_stack" in metafunc.fixturenames:
|
|
available_fixtures = {
|
|
"eval": POST_TRAINING_FIXTURES,
|
|
"datasetio": DATASETIO_FIXTURES,
|
|
}
|
|
combinations = (
|
|
get_provider_fixture_overrides(metafunc.config, available_fixtures) or DEFAULT_PROVIDER_COMBINATIONS
|
|
)
|
|
metafunc.parametrize("post_training_stack", combinations, indirect=True)
|