code: def test_init_raises_error_when_data_type_is_not_supported(
      self,
  ) -> None:
      with pytest.raises(
          ValueError, match=r"^Only integral types are supported\.$"
      ):
          StrToTensorConverter(dtype=torch.half)
  
file_path: fairseq2/tests/unit/data/text/test_str_to_tensor_converter.py
imports: from typing import Any, Optional, Sequence
  import pytest
  import torch
  from fairseq2.data.text.converters import StrToTensorConverter
  from fairseq2.typing import DataType
  from tests.common import assert_equal
label_desc: Use image node_id 1 for calling the TestStrToTensorConverter obj's underlying member method code with example usage: obj.test_init_raises_error_when_data_type_is_not_supported() without return types