test_runtime_utils.py 352 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest

import deepspeed.runtime.utils as ds_utils


def test_call_to_str():
    c2s = ds_utils.call_to_str

    assert c2s('int') == 'int()'
    assert c2s('int', 3) == 'int(3)'
    assert c2s('int', 3, 'jeff') == 'int(3, \'jeff\')'

    assert c2s('hello', val=3) == 'hello(val=3)'
    assert c2s('hello', 1138, val=3) == 'hello(1138, val=3)'