test_runtime_utils.py 352 B

1234567891011121314
  1. import pytest
  2. import deepspeed.runtime.utils as ds_utils
  3. def test_call_to_str():
  4. c2s = ds_utils.call_to_str
  5. assert c2s('int') == 'int()'
  6. assert c2s('int', 3) == 'int(3)'
  7. assert c2s('int', 3, 'jeff') == 'int(3, \'jeff\')'
  8. assert c2s('hello', val=3) == 'hello(val=3)'
  9. assert c2s('hello', 1138, val=3) == 'hello(1138, val=3)'