code: def test_only_train_read_for_vocab(self, caplog):
      params = Params(
          {
              "dataset_reader": {"type": "train-util-test-reader"},
              "train_data_path": "path-to-training-file",
              "data_loader": {"batch_size": 2},
          }
      )
      _ = make_vocab_from_params(params, str(self.TEST_DIR))
      log_messages = "\n".join([rec.message for rec in caplog.records])
      assert (
          "...train-util-test-reader reading from path-to-training-file"
          in log_messages
      )
      assert (
          "...train-util-test-reader reading from path-to-validation-file"
          not in log_messages
      )
      assert (
          "...train-util-test-reader reading from path-to-test-file"
          not in log_messages
      )
      assert "Reading training data" in log_messages
      assert "Reading validation data" not in log_messages
      assert "Reading test data" not in log_messages
  
imports: import logging
  import os
  import pickle
  import pytest
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.params import Params
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.instance import Instance
  from allennlp.data.dataset_readers import DatasetReader
  from allennlp.data.fields import LabelField
  from allennlp.models import Model
  from allennlp.training.util import make_vocab_from_params, get_metrics
label_desc: Use image node_id 2 for calling the TestMakeVocabFromParams obj's underlying member method code with example usage: obj.test_only_train_read_for_vocab(caplog) without return types