code: def test_dataset_from_text_features(features, text_path, tmp_path):
      cache_dir = tmp_path / "cache"
      default_expected_features = {"text": "string"}
      expected_features = (
          features.copy() if features else default_expected_features
      )
      features = (
          Features(
              {
                  feature: Value(dtype)
                  for feature, dtype in features.items()
              }
          )
          if features is not None
          else None
      )
      dataset = TextDatasetReader(
          text_path, features=features, cache_dir=cache_dir
      ).read()
      _check_text_dataset(dataset, expected_features)
  
file_path: datasets/tests/io/test_text.py
imports: import pytest
  from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
  from datasets.io.text import TextDatasetReader
  from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
label_desc: Use image node_id 3 for calling a global function with example usage: test_dataset_from_text_features(features, text_path, tmp_path) without return types