class_docstr: 使用 OneflowSingleDriver 测试基类的函数
class_docstr_tok: ["\u4f7f\u7528","OneflowSingleDriver","\u6d4b\u8bd5\u57fa\u7c7b\u7684\u51fd\u6570"]
docstr: 测试 check_dataloader_legality 函数传入其他类型的表现
docstr_tok: ["\u6d4b\u8bd5","check_dataloader_legality","\u51fd\u6570\u4f20\u5165\u5176\u4ed6\u7c7b\u578b\u7684\u8868\u73b0"]
code: def test_check_dataloader_legality_invalid(self):
      """
      测试 check_dataloader_legality 函数传入其他类型的表现
      """
      # 创建 torch 的 dataloader
      dataloader = torch.utils.data.DataLoader(
          TorchNormalDataset(), batch_size=32, shuffle=True
      )
      with pytest.raises(TypeError):
          self.driver.check_dataloader_legality(dataloader)
  
imports: import pytest
  from pathlib import Path
  from fastNLP.core.drivers.oneflow_driver.single_device import OneflowSingleDriver
  from fastNLP.core.samplers import ReproduceBatchSampler, RandomSampler
  from tests.helpers.models.oneflow_model import OneflowNormalModel_Classification_1
  from tests.helpers.datasets.oneflow_data import OneflowNormalDataset, OneflowNormalXYDataset
  from tests.helpers.datasets.torch_data import TorchNormalDataset
  from tests.helpers.models.torch_model import TorchNormalModel_Classification_1
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.envs.imports import _NEED_IMPORT_ONEFLOW, _NEED_IMPORT_TORCH
  from fastNLP import prepare_oneflow_dataloader, BucketedBatchSampler
label_desc: Use image node_id 5 for calling the TestOneflowDriverFunctions obj's underlying member method code with example usage: obj.test_check_dataloader_legality_invalid() without return types