code: def test_hostfiles_bad():
      # duplicate host
      hostfile = """
      worker-1 slots=2
      worker-2 slots=1
      worker-1 slots=1
      """
      with pytest.raises(ValueError):
          dsrun._parse_hostfile(hostfile.splitlines())
  
      # incorrect whitespace
      hostfile = """
      this is bad slots=1
      """
      with pytest.raises(ValueError):
          dsrun._parse_hostfile(hostfile.splitlines())
  
      # no whitespace
      hostfile = """
      missingslots
      """
      with pytest.raises(ValueError):
          dsrun._parse_hostfile(hostfile.splitlines())
  
      # empty
      hostfile = """
      """
      with pytest.raises(ValueError):
          dsrun._parse_hostfile(hostfile.splitlines())
  
      # mix of good/bad
      hostfile = """
      worker-1 slots=2
      this is bad slots=1
      worker-2 slots=4
      missingslots
  
      """
      with pytest.raises(ValueError):
          dsrun._parse_hostfile(hostfile.splitlines())
  
file_path: deepspeed/tests/unit/launcher/test_run.py
imports: import pytest
  from deepspeed.launcher import runner
label_desc: Use image node_id 7 for calling a global function with example usage: test_hostfiles_bad() without return types