Convert formatting to use ruff instead of yapf + isort (#26247)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -46,23 +46,22 @@ def log_stats_enabled_engine_args():
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_llm_replace_default_loggers(
|
||||
log_stats_enabled_engine_args):
|
||||
async def test_async_llm_replace_default_loggers(log_stats_enabled_engine_args):
|
||||
"""
|
||||
RayPrometheusStatLogger should replace the default PrometheusStatLogger
|
||||
"""
|
||||
|
||||
engine = AsyncLLM.from_engine_args(log_stats_enabled_engine_args,
|
||||
stat_loggers=[RayPrometheusStatLogger])
|
||||
assert isinstance(engine.logger_manager.prometheus_logger,
|
||||
RayPrometheusStatLogger)
|
||||
engine = AsyncLLM.from_engine_args(
|
||||
log_stats_enabled_engine_args, stat_loggers=[RayPrometheusStatLogger]
|
||||
)
|
||||
assert isinstance(engine.logger_manager.prometheus_logger, RayPrometheusStatLogger)
|
||||
engine.shutdown()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_llm_add_to_default_loggers(log_stats_enabled_engine_args):
|
||||
"""
|
||||
It's still possible to use custom stat loggers exclusively by passing
|
||||
It's still possible to use custom stat loggers exclusively by passing
|
||||
disable_log_stats=True in addition to a list of custom stat loggers.
|
||||
"""
|
||||
# Create engine_args with disable_log_stats=True for this test
|
||||
@@ -70,12 +69,14 @@ async def test_async_llm_add_to_default_loggers(log_stats_enabled_engine_args):
|
||||
disabled_log_engine_args.disable_log_stats = True
|
||||
|
||||
# Disable default loggers; pass custom stat logger to the constructor
|
||||
engine = AsyncLLM.from_engine_args(disabled_log_engine_args,
|
||||
stat_loggers=[DummyStatLogger])
|
||||
engine = AsyncLLM.from_engine_args(
|
||||
disabled_log_engine_args, stat_loggers=[DummyStatLogger]
|
||||
)
|
||||
|
||||
assert len(engine.logger_manager.per_engine_logger_dict[0]) == 1
|
||||
assert isinstance(engine.logger_manager.per_engine_logger_dict[0][0],
|
||||
DummyStatLogger)
|
||||
assert isinstance(
|
||||
engine.logger_manager.per_engine_logger_dict[0][0], DummyStatLogger
|
||||
)
|
||||
|
||||
# log_stats is still True, since custom stat loggers are used
|
||||
assert engine.log_stats
|
||||
|
||||
Reference in New Issue
Block a user