Skip to content

Commit 600553f

Browse files
author
Felipe Mello
committed
fix tests
1 parent 928f03b commit 600553f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/unit_tests/observability/test_metrics.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ def test_new_enums_and_constants(self):
8585
async def test_backend_role_usage(self):
8686
"""Test that BackendRole constants are actually used instead of string literals."""
8787
# Test ConsoleBackend
88-
console_backend = ConsoleBackend({})
88+
console_backend = ConsoleBackend(logging_mode=LoggingMode.GLOBAL_REDUCE)
8989
await console_backend.init(role=BackendRole.LOCAL)
9090

9191
# Test WandbBackend role validation without WandB initialization
9292
wandb_backend = WandbBackend(
93-
{"project": "test", "logging_mode": "global_reduce"}
93+
logging_mode=LoggingMode.GLOBAL_REDUCE, project="test"
9494
)
9595

9696
# Mock all the WandB init methods to focus only on role validation
@@ -298,15 +298,15 @@ def test_record_metric_enabled_explicit(self, mock_collector_class, mock_rank):
298298
def test_wandb_backend_creation(self):
299299
"""Test WandbBackend creation and basic setup without WandB dependency."""
300300

301-
config = {
302-
"project": "test_project",
303-
"group": "test_group",
304-
"logging_mode": "global_reduce",
305-
}
306-
backend = WandbBackend(config)
301+
backend = WandbBackend(
302+
logging_mode=LoggingMode.GLOBAL_REDUCE,
303+
project="test_project",
304+
group="test_group",
305+
)
307306

308-
assert backend.project == "test_project"
309-
assert backend.group == "test_group"
307+
# Test backend kwargs storage
308+
assert backend.backend_kwargs["project"] == "test_project"
309+
assert backend.backend_kwargs["group"] == "test_group"
310310
assert backend.logging_mode == LoggingMode.GLOBAL_REDUCE
311311
assert backend.per_rank_share_run is False # default
312312

@@ -317,7 +317,7 @@ def test_wandb_backend_creation(self):
317317
@pytest.mark.asyncio
318318
async def test_console_backend(self):
319319
"""Test ConsoleBackend basic operations."""
320-
backend = ConsoleBackend({})
320+
backend = ConsoleBackend(logging_mode=LoggingMode.GLOBAL_REDUCE)
321321

322322
await backend.init(role=BackendRole.LOCAL)
323323

0 commit comments

Comments
 (0)