evalstone/evalscope/tests/test_logger.py
sora 13274243a0 Bump vendored EvalScope and add K3-ready DPV4 configs.
Keep K3 suite selection and report-schema scoring in bash, merge K3/vision dataset_args into dpv4 yamls, and pin EvalScope at 735d920ee911 with local patches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 07:30:48 +00:00

18 lines
514 B
Python

import sys
from evalscope.utils import logger
def test_distributed_env_detection_does_not_import_torch_distributed(monkeypatch) -> None:
monkeypatch.delitem(sys.modules, 'torch.distributed', raising=False)
monkeypatch.setenv('WORLD_SIZE', '2')
monkeypatch.setenv('RANK', '1')
assert logger._is_torch_dist() is True
assert logger._is_torch_master() is False
assert 'torch.distributed' not in sys.modules
monkeypatch.setenv('RANK', '0')
assert logger._is_torch_master() is True